@atlaspack/runtime-js
Advanced tools
Comparing version
@@ -289,3 +289,3 @@ "use strict"; | ||
let relativePathExpr = getRelativePathExpr(bundle, referencedBundle, options); | ||
let loaderCode = `require(${JSON.stringify(loader)})(${getAbsoluteUrlExpr(relativePathExpr, bundle, referencedBundle, config.domainSharding)})`; | ||
let loaderCode = `require(${JSON.stringify(loader)})(${getAbsoluteUrlExpr(relativePathExpr, bundle, config.domainSharding)})`; | ||
assets.push({ | ||
@@ -416,3 +416,3 @@ filePath: __filename, | ||
} else { | ||
absoluteUrlExpr = getAbsoluteUrlExpr(relativePathExpr, bundle, to, shardingConfig); | ||
absoluteUrlExpr = getAbsoluteUrlExpr(relativePathExpr, bundle, shardingConfig); | ||
} | ||
@@ -540,3 +540,3 @@ let code = `require(${JSON.stringify(loader)})(${absoluteUrlExpr})`; | ||
let priority = TYPE_TO_RESOURCE_PRIORITY[bundleToPreload.type]; | ||
hintLoaders.push(`require(${JSON.stringify(loader)})(${getAbsoluteUrlExpr(relativePathExpr, from, bundleToPreload)}, ${priority ? JSON.stringify(priority) : 'null'}, ${JSON.stringify(bundleToPreload.target.env.outputFormat === 'esmodule')})`); | ||
hintLoaders.push(`require(${JSON.stringify(loader)})(${getAbsoluteUrlExpr(relativePathExpr, from)}, ${priority ? JSON.stringify(priority) : 'null'}, ${JSON.stringify(bundleToPreload.target.env.outputFormat === 'esmodule')})`); | ||
} | ||
@@ -568,3 +568,3 @@ } | ||
} else { | ||
code = `module.exports = ${getAbsoluteUrlExpr(relativePathExpr, from, to, shardingConfig)};`; | ||
code = `module.exports = ${getAbsoluteUrlExpr(relativePathExpr, from, shardingConfig)};`; | ||
} | ||
@@ -617,3 +617,3 @@ return { | ||
} | ||
function getAbsoluteUrlExpr(relativePathExpr, fromBundle, toBundle, shardingConfig) { | ||
function getAbsoluteUrlExpr(relativePathExpr, fromBundle, shardingConfig) { | ||
if (fromBundle.env.outputFormat === 'esmodule' && fromBundle.env.supports('import-meta-url') || fromBundle.env.outputFormat === 'commonjs') { | ||
@@ -620,0 +620,0 @@ // This will be compiled to new URL(url, import.meta.url) or new URL(url, 'file:' + __filename). |
{ | ||
"name": "@atlaspack/runtime-js", | ||
"version": "2.12.1-canary.3596+249e25cee", | ||
"version": "2.12.1-canary.3597+d444767b9", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -15,14 +15,14 @@ "publishConfig": { | ||
"engines": { | ||
"atlaspack": "2.12.1-canary.3596+249e25cee", | ||
"atlaspack": "2.12.1-canary.3597+d444767b9", | ||
"node": ">= 16.0.0" | ||
}, | ||
"dependencies": { | ||
"@atlaspack/diagnostic": "2.12.1-canary.3596+249e25cee", | ||
"@atlaspack/domain-sharding": "2.12.1-canary.3596+249e25cee", | ||
"@atlaspack/feature-flags": "2.12.1-canary.3596+249e25cee", | ||
"@atlaspack/plugin": "2.12.1-canary.3596+249e25cee", | ||
"@atlaspack/utils": "2.12.1-canary.3596+249e25cee", | ||
"@atlaspack/diagnostic": "2.12.1-canary.3597+d444767b9", | ||
"@atlaspack/domain-sharding": "2.12.1-canary.3597+d444767b9", | ||
"@atlaspack/feature-flags": "2.12.1-canary.3597+d444767b9", | ||
"@atlaspack/plugin": "2.12.1-canary.3597+d444767b9", | ||
"@atlaspack/utils": "2.12.1-canary.3597+d444767b9", | ||
"nullthrows": "^1.1.1" | ||
}, | ||
"gitHead": "249e25cee937192b45622a204c8262b47ec0f087" | ||
"gitHead": "d444767b9661b3dec94771ccc01a29d95eab51d0" | ||
} |
@@ -325,3 +325,2 @@ // @flow strict-local | ||
bundle, | ||
referencedBundle, | ||
config.domainSharding, | ||
@@ -501,3 +500,2 @@ )})`; | ||
bundle, | ||
to, | ||
shardingConfig, | ||
@@ -701,3 +699,2 @@ ); | ||
from, | ||
bundleToPreload, | ||
)}, ${priority ? JSON.stringify(priority) : 'null'}, ${JSON.stringify( | ||
@@ -765,3 +762,2 @@ bundleToPreload.target.env.outputFormat === 'esmodule', | ||
from, | ||
to, | ||
shardingConfig, | ||
@@ -841,3 +837,2 @@ )};`; | ||
fromBundle: NamedBundle, | ||
toBundle: NamedBundle, | ||
shardingConfig: JSRuntimeConfig['domainSharding'], | ||
@@ -844,0 +839,0 @@ ) { |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
102597
-0.15%2292
-0.22%