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

webpack-manifest-resource-plugin

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-manifest-resource-plugin - npm Package Compare versions

Comparing version 4.2.0 to 4.2.1

34

lib/plugin.js

@@ -67,3 +67,3 @@ var path = require('path');

ManifestPlugin.prototype.getDeps = function(manifest, commonsChunk) {
ManifestPlugin.prototype.getDeps = function(compiler, manifest, commonsChunk) {
const deps = {};

@@ -80,13 +80,15 @@ const commonChunkScript = [];

});
Object.keys(manifest).forEach(pageKey => {
if (/\.js$/.test(pageKey)) {
const dllScript = [];
const dllCss = [];
const pageName = pageKey.replace(/\.js$/, '');
const isCommonsChunk = commonsChunk.find(chunk => {
return chunk === pageName || typeof chunk === 'object' && chunk.name === pageName;
});
const webpackConfig = compiler.options;
const entryNames = Object.keys(webpackConfig.entry);
entryNames.forEach(entryName => {
const dllScript = [];
const dllCss = [];
const pageName = entryName.replace(/\.js$/, '');
const isCommonsChunk = commonsChunk.find(chunk => {
return chunk === pageName || typeof chunk === 'object' && chunk.name === pageName;
});
if(!isCommonsChunk) {
commonsChunk.forEach(dll => {
if (typeof dll === 'object') {
if (!isCommonsChunk && this.isMatch(dll.include, pageName, true) && !this.isMatch(dll.exclude, pageName, false)) {
if (this.isMatch(dll.include, pageName, true) && !this.isMatch(dll.exclude, pageName, false)) {
const jsKey = `${dll.name}.js`;

@@ -99,5 +101,5 @@ const cssKey = `${dll.name}.css`;

});
const js = dllScript.concat(commonChunkScript).concat(manifest[pageKey]);
const css = dllCss.concat(commonChunkCss).concat(manifest[pageKey.replace(/\.js$/, '.css')] || []);
deps[pageKey] = { js, css };
const js = dllScript.concat(commonChunkScript).concat(manifest[`${pageName}.js`] || []);
const css = dllCss.concat(commonChunkCss).concat(manifest[`${pageName}.css`] || []);
deps[entryName] = { js, css };
}

@@ -108,3 +110,3 @@ });

ManifestPlugin.prototype.getResource = function(manifest, publicPath) {
ManifestPlugin.prototype.getResource = function(compiler, manifest, publicPath) {
const buildPath = this.opts.buildPath.replace(this.opts.baseDir, '').replace(/^\//, '');

@@ -149,3 +151,3 @@ const normalizeManifest = this.normalize(manifest);

publicPath = this.opts.proxy ? publicPath.replace(this.opts.host, '') : publicPath;
const depsManifest = this.getDeps(normalizeManifest, commonsChunk);
const depsManifest = this.getDeps(compiler, normalizeManifest, commonsChunk);
return Object.assign({}, normalizeManifest, {

@@ -279,3 +281,3 @@ deps: depsManifest,

var resource = this.getResource(manifest, publicPath);
var resource = this.getResource(compiler, manifest, publicPath);
var json = JSON.stringify(resource, null, 2);

@@ -282,0 +284,0 @@ var outputFolder = compilation.options.output.path;

{
"name": "webpack-manifest-resource-plugin",
"version": "4.2.0",
"version": "4.2.1",
"description": "webpack manifest resource dependencies plugin",

@@ -5,0 +5,0 @@ "keywords": [

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