webpack-manifest-resource-plugin
Advanced tools
Comparing version 4.0.0 to 4.2.0
@@ -109,2 +109,5 @@ var path = require('path'); | ||
const manifestDll = this.opts.manifestDll; | ||
const dllConfig = this.opts.dllConfig; | ||
const dllDir = this.opts.dllDir; | ||
const dllChunk = this.opts.dllChunk; | ||
if (manifestDll && typeof manifestDll === 'boolean') { | ||
@@ -114,12 +117,24 @@ return this.normalizeFile(normalizeManifest, this.opts.host); | ||
let commonsChunk = []; | ||
const dllConfig = this.opts.dllConfig; | ||
if (dllConfig) { // 合并 dll manifest 到 manifest | ||
const dllDir = this.opts.dllDir; | ||
if(dllChunk) { // for webpack4 4.2.0 | ||
const dll = dllChunk.dll; | ||
const names = dllChunk.names; | ||
const chunks = dllChunk.chunks; | ||
chunks.forEach(chunk => { | ||
normalizeManifest[chunk.id] = chunk.outputPath; | ||
}); | ||
commonsChunk = [].concat(dll); | ||
} else if (dllConfig && dllDir) { // 合并 dll manifest 到 manifest for webpack3 | ||
const dllArray = Array.isArray(dllConfig) ? dllConfig : [dllConfig]; | ||
dllArray.forEach(item => { | ||
const dllManifestPath = path.join(dllDir, `config/manifest-${item.name}.json`); | ||
if (fs.existsSync(dllManifestPath)) { | ||
const dllManifestJSON = require(dllManifestPath); | ||
Object.keys(dllManifestJSON).forEach(key => { | ||
normalizeManifest[key] = dllManifestJSON[key]; | ||
const newDllManifestPath = path.join(dllDir, `manifest-${item.name}.json`); | ||
const oldDllManifestPath = path.join(dllDir, `config/manifest-${item.name}.json`); | ||
let dllManifest; | ||
if (fs.existsSync(newDllManifestPath)) { | ||
dllManifest= require(newDllManifestPath); | ||
} else if (fs.existsSync(oldDllManifestPath)) { | ||
dllManifest= require(oldDllManifestPath); | ||
} | ||
if(dllManifest) { | ||
Object.keys(dllManifest).forEach(key => { | ||
normalizeManifest[key] = dllManifest[key]; | ||
}); | ||
@@ -126,0 +141,0 @@ commonsChunk.push(item); |
{ | ||
"name": "webpack-manifest-resource-plugin", | ||
"version": "4.0.0", | ||
"version": "4.2.0", | ||
"description": "webpack manifest resource dependencies plugin", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
14413
295
4