webpack-manifest-resource-plugin
Advanced tools
Comparing version 1.0.0 to 1.1.0-beta.1
@@ -48,5 +48,5 @@ var path = require('path'); | ||
const normalizeValue = manifest[key].replace(/\\/g, '/'); | ||
if(this.opts.proxy){ | ||
normalizeManifest[normalizeKey] = normalizeValue.replace(this.opts.host,''); | ||
}else{ | ||
if (this.opts.proxy) { | ||
normalizeManifest[normalizeKey] = normalizeValue.replace(this.opts.host, ''); | ||
} else { | ||
normalizeManifest[normalizeKey] = normalizeValue; | ||
@@ -80,2 +80,23 @@ } | ||
ManifestPlugin.prototype.getResource = function(manifest, publicPath) { | ||
var buildPath = this.opts.buildPath.replace(this.opts.baseDir, '').replace(/^\//, ''); | ||
var fileNormalizeManifest = this.normalizeFile(manifest, publicPath); | ||
var normalizeManifest = this.normalize(manifest); | ||
var manifestDll = this.opts.manifestDll; | ||
if (manifestDll && typeof manifestDll === 'boolean') { | ||
return normalizeManifest; | ||
} else { | ||
if (manifestDll && typeof manifestDll === 'object') { | ||
Object.keys(manifestDll).forEach(key => { | ||
normalizeManifest[key] = manifestDll[key]; | ||
}); | ||
} | ||
var depsManifest = this.getDeps(normalizeManifest, this.opts.commonsChunk); | ||
return Object.assign({}, fileNormalizeManifest, { | ||
deps: depsManifest, | ||
info: { publicPath, buildPath } | ||
}); | ||
} | ||
}; | ||
ManifestPlugin.prototype.apply = function(compiler) { | ||
@@ -202,10 +223,4 @@ var seed = this.opts.seed || {}; | ||
} | ||
var buildPath = this.opts.buildPath.replace(this.opts.baseDir, '').replace(/^\//, ''); | ||
var fileNormalizeManifest = this.normalizeFile(manifest, publicPath); | ||
var normalizeManifest = this.normalize(manifest); | ||
var depsManifest = this.getDeps(normalizeManifest, this.opts.commonsChunk); | ||
var resource = Object.assign({}, fileNormalizeManifest, { | ||
deps: depsManifest, | ||
info: { publicPath, buildPath} | ||
}); | ||
var resource = this.getResource(manifest, publicPath); | ||
var json = JSON.stringify(resource, null, 2); | ||
@@ -212,0 +227,0 @@ |
{ | ||
"name": "webpack-manifest-resource-plugin", | ||
"version": "1.0.0", | ||
"version": "1.1.0-beta.1", | ||
"description": "manifest resource dependencies", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# webpack-manifest-resource-plugin | ||
normalize js resource dependencies for [webpack-manifest-plugin](https://github.com/danethurber/webpack-manifest-plugin) | ||
normalize js/css resource dependencies for [webpack-manifest-plugin](https://github.com/danethurber/webpack-manifest-plugin) | ||
@@ -31,9 +31,9 @@ | ||
{ | ||
res: { | ||
"mods/alpha.js": "mods/alpha.1234567890.js", | ||
"mods/alpha.css": "mods/alpha.435336266.css", | ||
"mods/omega.js": "mods/omega.0987654321.js", | ||
"mods/omega.css": "mods/omega.323299900.css", | ||
"vendor": "vendor.32465656.js" | ||
}, | ||
"mods/alpha.js": "mods/alpha.1234567890.js", | ||
"mods/alpha.css": "mods/alpha.435336266.css", | ||
"mods/omega.js": "mods/omega.0987654321.js", | ||
"mods/omega.css": "mods/omega.323299900.css", | ||
"vendor": "vendor.32465656.js" | ||
deps:{ | ||
@@ -40,0 +40,0 @@ "mods/alpha.js":{ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
11023
222
1