Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/packager-html

Package Overview
Dependencies
Maintainers
1
Versions
893
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/packager-html - npm Package Compare versions

Comparing version 2.0.0-nightly.201 to 2.0.0-nightly.203

13

lib/HTMLPackager.js

@@ -37,7 +37,16 @@ "use strict";

let asset = assets[0];
let code = await asset.getCode(); // Insert references to sibling bundles. For example, a <script> tag in the original HTML
let code = await asset.getCode();
let dependencies = [];
bundle.traverse(node => {
if (node.type === 'dependency') {
dependencies.push(node.value);
}
}); // Insert references to sibling bundles. For example, a <script> tag in the original HTML
// may import CSS files. This will result in a sibling bundle in the same bundle group as the
// JS. This will be inserted as a <link> element into the HTML here.
let bundleGroups = bundleGraph.getExternalDependencies(bundle).map(dependency => bundleGraph.resolveExternalDependency(dependency)).filter(Boolean);
let bundleGroups = dependencies.map(dependency => bundleGraph.resolveExternalDependency(dependency, bundle)).filter(resolved => resolved != null && resolved.type === 'bundle_group').map(resolved => {
(0, _assert.default)(resolved != null && resolved.type === 'bundle_group');
return resolved.value;
});
let bundles = bundleGroups.reduce((p, bundleGroup) => {

@@ -44,0 +53,0 @@ let bundles = bundleGraph.getBundlesInBundleGroup(bundleGroup).filter(bundle => !bundle.getEntryAssets().some(asset => asset.id === bundleGroup.entryAssetId));

10

package.json
{
"name": "@parcel/packager-html",
"version": "2.0.0-nightly.201+83e272ba",
"version": "2.0.0-nightly.203+f6d2a707",
"license": "MIT",

@@ -19,9 +19,9 @@ "publishConfig": {

"dependencies": {
"@parcel/plugin": "2.0.0-nightly.201+83e272ba",
"@parcel/types": "2.0.0-nightly.201+83e272ba",
"@parcel/utils": "2.0.0-nightly.201+83e272ba",
"@parcel/plugin": "2.0.0-nightly.203+f6d2a707",
"@parcel/types": "2.0.0-nightly.203+f6d2a707",
"@parcel/utils": "2.0.0-nightly.203+f6d2a707",
"nullthrows": "^1.1.1",
"posthtml": "^0.11.3"
},
"gitHead": "83e272ba8b6fc51651f564da9edbb69576695e2f"
"gitHead": "f6d2a707c932032c39064cf53dd74b2b687e310e"
}

@@ -5,2 +5,3 @@ // @flow strict-local

import assert from 'assert';
import invariant from 'assert';
import {Packager} from '@parcel/plugin';

@@ -35,9 +36,21 @@ import posthtml from 'posthtml';

let dependencies = [];
bundle.traverse(node => {
if (node.type === 'dependency') {
dependencies.push(node.value);
}
});
// Insert references to sibling bundles. For example, a <script> tag in the original HTML
// may import CSS files. This will result in a sibling bundle in the same bundle group as the
// JS. This will be inserted as a <link> element into the HTML here.
let bundleGroups = bundleGraph
.getExternalDependencies(bundle)
.map(dependency => bundleGraph.resolveExternalDependency(dependency))
.filter(Boolean);
let bundleGroups = dependencies
.map(dependency =>
bundleGraph.resolveExternalDependency(dependency, bundle),
)
.filter(resolved => resolved != null && resolved.type === 'bundle_group')
.map(resolved => {
invariant(resolved != null && resolved.type === 'bundle_group');
return resolved.value;
});
let bundles = bundleGroups.reduce((p, bundleGroup) => {

@@ -44,0 +57,0 @@ let bundles = bundleGraph

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc