@parcel/packager-html
Advanced tools
Comparing version 2.0.0-nightly.72 to 2.0.0-nightly.79
@@ -47,3 +47,6 @@ "use strict"; | ||
return p.concat(bundles); | ||
}, []); | ||
}, []); // Add bundles in the same bundle group that are not inline. For example, if two inline | ||
// bundles refer to the same library that is extracted into a shared bundle. | ||
bundles = bundles.concat(bundleGraph.getSiblingBundles(bundle).filter(b => !b.isInline)); | ||
let { | ||
@@ -78,3 +81,6 @@ html | ||
const bundleResult = await getInlineBundleContents(inlineBundle, bundleGraph); | ||
return bundleResult.contents; | ||
return { | ||
bundle: inlineBundle, | ||
contents: bundleResult.contents | ||
}; | ||
} | ||
@@ -99,4 +105,13 @@ | ||
if (newContent != null) { | ||
node.content = newContent; // remove attr from output | ||
let { | ||
contents, | ||
bundle | ||
} = newContent; | ||
node.content = contents; | ||
if (bundle.env.outputFormat === 'esmodule') { | ||
node.attrs.type = 'module'; | ||
} // remove attr from output | ||
delete node.attrs['data-parcel-key']; | ||
@@ -129,2 +144,3 @@ } | ||
attrs: { | ||
type: bundle.env.outputFormat === 'esmodule' ? 'module' : undefined, | ||
src: (0, _utils.urlJoin)((_nullthrows$publicUrl2 = (0, _nullthrows.default)(bundle.target).publicUrl) !== null && _nullthrows$publicUrl2 !== void 0 ? _nullthrows$publicUrl2 : '/', (0, _nullthrows.default)(bundle.name)) | ||
@@ -131,0 +147,0 @@ } |
{ | ||
"name": "@parcel/packager-html", | ||
"version": "2.0.0-nightly.72+a0d19756", | ||
"version": "2.0.0-nightly.79+287ac639", | ||
"license": "MIT", | ||
@@ -19,9 +19,9 @@ "publishConfig": { | ||
"dependencies": { | ||
"@parcel/plugin": "2.0.0-nightly.72+a0d19756", | ||
"@parcel/types": "2.0.0-nightly.72+a0d19756", | ||
"@parcel/utils": "2.0.0-nightly.72+a0d19756", | ||
"@parcel/plugin": "2.0.0-nightly.79+287ac639", | ||
"@parcel/types": "2.0.0-nightly.79+287ac639", | ||
"@parcel/utils": "2.0.0-nightly.79+287ac639", | ||
"nullthrows": "^1.1.1", | ||
"posthtml": "^0.11.3" | ||
}, | ||
"gitHead": "a0d19756a842b80ae8114b9e664a3b84057fcb70" | ||
"gitHead": "287ac6397ade28595d56ac73971edb832bda8ff7" | ||
} |
// @flow strict-local | ||
import type {Blob, Bundle, BundleGraph} from '@parcel/types'; | ||
import type {Bundle, BundleGraph} from '@parcel/types'; | ||
@@ -50,2 +50,8 @@ import assert from 'assert'; | ||
// Add bundles in the same bundle group that are not inline. For example, if two inline | ||
// bundles refer to the same library that is extracted into a shared bundle. | ||
bundles = bundles.concat( | ||
bundleGraph.getSiblingBundles(bundle).filter(b => !b.isInline), | ||
); | ||
let {html} = await posthtml([ | ||
@@ -72,3 +78,3 @@ insertBundleReferences.bind(this, bundles), | ||
assetId, | ||
): Promise<?Blob> { | ||
) { | ||
let inlineBundle: ?Bundle; | ||
@@ -89,3 +95,3 @@ bundleGraph.traverseBundles((bundle, context, {stop}) => { | ||
return bundleResult.contents; | ||
return {bundle: inlineBundle, contents: bundleResult.contents}; | ||
} | ||
@@ -117,4 +123,9 @@ | ||
if (newContent != null) { | ||
node.content = newContent; | ||
let {contents, bundle} = newContent; | ||
node.content = contents; | ||
if (bundle.env.outputFormat === 'esmodule') { | ||
node.attrs.type = 'module'; | ||
} | ||
// remove attr from output | ||
@@ -147,2 +158,3 @@ delete node.attrs['data-parcel-key']; | ||
attrs: { | ||
type: bundle.env.outputFormat === 'esmodule' ? 'module' : undefined, | ||
src: urlJoin( | ||
@@ -149,0 +161,0 @@ nullthrows(bundle.target).publicUrl ?? '/', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
12016
319