Socket
Socket
Sign inDemoInstall

preload-webpack-plugin

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preload-webpack-plugin - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

22

index.js

@@ -26,9 +26,22 @@ /**

const isChunkBelongToHtml = (chunk, roots) => {
const doesChunkBelongToHTML = (chunk, roots, visitedChunks) => {
// Prevent circular recursion.
// See https://github.com/GoogleChromeLabs/preload-webpack-plugin/issues/49
if (visitedChunks[chunk.renderedHash]) {
return false;
}
visitedChunks[chunk.renderedHash] = true;
for (const root of roots) {
if (root.hash === chunk.renderedHash) return true;
if (root.hash === chunk.renderedHash) {
return true;
}
}
for (const parent of chunk.parents) {
if (isChunkBelongToHtml(parent, roots)) return true;
if (doesChunkBelongToHTML(parent, roots, visitedChunks)) {
return true;
}
}
return false;

@@ -84,3 +97,4 @@ };

// Only handle the chunk import by the htmlWebpackPlugin
extractedChunks = extractedChunks.filter(chunk => isChunkBelongToHtml(chunk, Object.values(htmlPluginData.assets.chunks)));
extractedChunks = extractedChunks.filter(chunk => doesChunkBelongToHTML(
chunk, Object.values(htmlPluginData.assets.chunks), {}));

@@ -87,0 +101,0 @@ flatten(extractedChunks.map(chunk => chunk.files)).filter(entry => {

2

package.json
{
"name": "preload-webpack-plugin",
"version": "2.1.1",
"version": "2.1.2",
"description": "Enhances html-webpack-plugin with link rel=preload wiring capabilities for scripts",

@@ -5,0 +5,0 @@ "main": "index.js",

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