@parcel/scope-hoisting
Advanced tools
Comparing version 2.0.0-nightly.242 to 2.0.0-nightly.249
@@ -289,7 +289,10 @@ "use strict"; | ||
function addBundleImport(mod, path) { | ||
// Find the first bundle containing this asset, and create an import for it if needed. | ||
// An asset may be duplicated in multiple bundles, so try to find one that matches | ||
// the current environment if possible and fall back to the first one. | ||
let bundles = bundleGraph.findBundlesWithAsset(mod); | ||
let importedBundle = bundles.find(b => b.env.context === bundle.env.context) || bundles[0]; | ||
// Find a bundle that's reachable from the current bundle (sibling or ancestor) | ||
// containing this asset, and create an import for it if needed. | ||
let importedBundle = bundleGraph.findReachableBundleWithAsset(bundle, mod); | ||
if (!importedBundle) { | ||
throw new Error(`No reachable bundle found containing ${(0, _path.relative)(options.inputFS.cwd(), mod.filePath)}`); | ||
} | ||
let filePath = (0, _nullthrows.default)(importedBundle.filePath); | ||
@@ -296,0 +299,0 @@ let imported = importedFiles.get(filePath); |
{ | ||
"name": "@parcel/scope-hoisting", | ||
"version": "2.0.0-nightly.242+ac5e8071", | ||
"version": "2.0.0-nightly.249+e63c77c8", | ||
"description": "Blazing fast, zero configuration web application bundler", | ||
@@ -24,9 +24,9 @@ "license": "MIT", | ||
"@babel/types": "^7.3.3", | ||
"@parcel/babylon-walk": "2.0.0-nightly.1864+ac5e8071", | ||
"@parcel/diagnostic": "2.0.0-nightly.242+ac5e8071", | ||
"@parcel/babylon-walk": "2.0.0-nightly.1871+e63c77c8", | ||
"@parcel/diagnostic": "2.0.0-nightly.249+e63c77c8", | ||
"@parcel/source-map": "2.0.0-alpha.4.9", | ||
"@parcel/utils": "2.0.0-nightly.242+ac5e8071", | ||
"@parcel/utils": "2.0.0-nightly.249+e63c77c8", | ||
"nullthrows": "^1.1.1" | ||
}, | ||
"gitHead": "ac5e807141df2ab1d83853b631551b28643b5869" | ||
"gitHead": "e63c77c800f95d64b835212632d1a9ed2db9f381" | ||
} |
@@ -332,8 +332,14 @@ // @flow | ||
function addBundleImport(mod, path) { | ||
// Find the first bundle containing this asset, and create an import for it if needed. | ||
// An asset may be duplicated in multiple bundles, so try to find one that matches | ||
// the current environment if possible and fall back to the first one. | ||
let bundles = bundleGraph.findBundlesWithAsset(mod); | ||
let importedBundle = | ||
bundles.find(b => b.env.context === bundle.env.context) || bundles[0]; | ||
// Find a bundle that's reachable from the current bundle (sibling or ancestor) | ||
// containing this asset, and create an import for it if needed. | ||
let importedBundle = bundleGraph.findReachableBundleWithAsset(bundle, mod); | ||
if (!importedBundle) { | ||
throw new Error( | ||
`No reachable bundle found containing ${relative( | ||
options.inputFS.cwd(), | ||
mod.filePath, | ||
)}`, | ||
); | ||
} | ||
let filePath = nullthrows(importedBundle.filePath); | ||
@@ -340,0 +346,0 @@ let imported = importedFiles.get(filePath); |
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
5713