webpack-manifest-resource-plugin
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -34,2 +34,11 @@ var path = require('path'); | ||
// old version not include publicPath | ||
ManifestPlugin.prototype.normalizeFile = function(manifest, publicPath) { | ||
var normalizeManifest = {}; | ||
Object.keys(manifest).forEach(key => { | ||
normalizeManifest[key] = manifest[key].replace(publicPath, ''); | ||
}); | ||
return normalizeManifest; | ||
}; | ||
ManifestPlugin.prototype.normalize = function(manifest) { | ||
@@ -40,3 +49,7 @@ var normalizeManifest = {}; | ||
const normalizeValue = manifest[key].replace(/\\/g, '/'); | ||
normalizeManifest[normalizeKey] = normalizeValue; | ||
if(this.opts.proxy){ | ||
normalizeManifest[normalizeKey] = normalizeValue.replace(this.opts.host,''); | ||
}else{ | ||
normalizeManifest[normalizeKey] = normalizeValue; | ||
} | ||
}); | ||
@@ -189,6 +202,10 @@ return normalizeManifest; | ||
} | ||
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 = { res: normalizeManifest, deps: depsManifest, info: { publicPath } }; | ||
var resource = Object.assign({}, fileNormalizeManifest, { | ||
deps: depsManifest, | ||
info: { publicPath, buildPath} | ||
}); | ||
var json = JSON.stringify(resource, null, 2); | ||
@@ -195,0 +212,0 @@ |
{ | ||
"name": "webpack-manifest-resource-plugin", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "js file resource dependencies", | ||
@@ -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
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
10505
209