mirror of https://github.com/webpack/webpack.git
Merge branch 'master' into deps/extract-text-webpack-plugin
This commit is contained in:
commit
838d416874
|
|
@ -36,6 +36,7 @@ module.exports = {
|
|||
"space-before-function-paren": ["error", "never"],
|
||||
"space-before-blocks": "error",
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"indent": "off",
|
||||
"keyword-spacing": ["error", {
|
||||
"after": false,
|
||||
"overrides": {
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ module.exports = function(yargs, argv, convertOptions) {
|
|||
binding += "-loader";
|
||||
}
|
||||
var rule = {
|
||||
test: new RegExp("\\." + name.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "$"),
|
||||
test: new RegExp("\\." + name.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "$"), // eslint-disable-line no-useless-escape
|
||||
loader: binding
|
||||
};
|
||||
if(arg === "module-bind-pre") {
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ module.exports = class MultiCompiler extends Tapable {
|
|||
get outputPath() {
|
||||
let commonPath = this.compilers[0].outputPath;
|
||||
for(const compiler of this.compilers) {
|
||||
while(compiler.outputPath.indexOf(commonPath) !== 0 && /[\/\\]/.test(commonPath)) {
|
||||
commonPath = commonPath.replace(/[\/\\][^\/\\]*$/, "");
|
||||
while(compiler.outputPath.indexOf(commonPath) !== 0 && /[/\\]/.test(commonPath)) {
|
||||
commonPath = commonPath.replace(/[/\\][^/\\]*$/, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,173 +50,161 @@ class NormalModuleFactory extends Tapable {
|
|||
this.cachePredicate = typeof options.unsafeCache === "function" ? options.unsafeCache : Boolean.bind(null, options.unsafeCache);
|
||||
this.context = context || "";
|
||||
this.parserCache = {};
|
||||
this.plugin("factory", function() {
|
||||
/* beautify preserve:start */
|
||||
// js-beautify consider to concat "return" and "("
|
||||
// but it сontradicts eslint rule (keyword-spacing)
|
||||
return (result, callback) => {
|
||||
/* beautify preserve:end */
|
||||
let resolver = this.applyPluginsWaterfall0("resolver", null);
|
||||
this.plugin("factory", () => (result, callback) => {
|
||||
let resolver = this.applyPluginsWaterfall0("resolver", null);
|
||||
|
||||
// Ignored
|
||||
if(!resolver) return callback();
|
||||
|
||||
resolver(result, (err, data) => {
|
||||
if(err) return callback(err);
|
||||
|
||||
// Ignored
|
||||
if(!resolver) return callback();
|
||||
if(!data) return callback();
|
||||
|
||||
resolver(result, (err, data) => {
|
||||
// direct module
|
||||
if(typeof data.source === "function")
|
||||
return callback(null, data);
|
||||
|
||||
this.applyPluginsAsyncWaterfall("after-resolve", data, (err, result) => {
|
||||
if(err) return callback(err);
|
||||
|
||||
// Ignored
|
||||
if(!data) return callback();
|
||||
if(!result) return callback();
|
||||
|
||||
// direct module
|
||||
if(typeof data.source === "function")
|
||||
return callback(null, data);
|
||||
let createdModule = this.applyPluginsBailResult("create-module", result);
|
||||
if(!createdModule) {
|
||||
|
||||
this.applyPluginsAsyncWaterfall("after-resolve", data, (err, result) => {
|
||||
if(err) return callback(err);
|
||||
|
||||
// Ignored
|
||||
if(!result) return callback();
|
||||
|
||||
let createdModule = this.applyPluginsBailResult("create-module", result);
|
||||
if(!createdModule) {
|
||||
|
||||
if(!result.request) {
|
||||
return callback(new Error("Empty dependency (no request)"));
|
||||
}
|
||||
|
||||
createdModule = new NormalModule(
|
||||
result.request,
|
||||
result.userRequest,
|
||||
result.rawRequest,
|
||||
result.loaders,
|
||||
result.resource,
|
||||
result.parser
|
||||
);
|
||||
if(!result.request) {
|
||||
return callback(new Error("Empty dependency (no request)"));
|
||||
}
|
||||
|
||||
createdModule = this.applyPluginsWaterfall0("module", createdModule);
|
||||
|
||||
return callback(null, createdModule);
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
this.plugin("resolver", function() {
|
||||
/* beautify preserve:start */
|
||||
// js-beautify consider to concat "return" and "("
|
||||
// but it сontradicts eslint rule (keyword-spacing)
|
||||
return (data, callback) => {
|
||||
/* beautify preserve:end */
|
||||
const contextInfo = data.contextInfo;
|
||||
const context = data.context;
|
||||
const request = data.request;
|
||||
|
||||
const noAutoLoaders = /^-?!/.test(request);
|
||||
const noPrePostAutoLoaders = /^!!/.test(request);
|
||||
const noPostAutoLoaders = /^-!/.test(request);
|
||||
let elements = request.replace(/^-?!+/, "").replace(/!!+/g, "!").split("!");
|
||||
let resource = elements.pop();
|
||||
elements = elements.map(identToLoaderRequest);
|
||||
|
||||
asyncLib.parallel([
|
||||
callback => this.resolveRequestArray(contextInfo, context, elements, this.resolvers.loader, callback),
|
||||
callback => {
|
||||
if(resource === "" || resource[0] === "?")
|
||||
return callback(null, {
|
||||
resource
|
||||
});
|
||||
|
||||
this.resolvers.normal.resolve(contextInfo, context, resource, (err, resource, resourceResolveData) => {
|
||||
if(err) return callback(err);
|
||||
callback(null, {
|
||||
resourceResolveData,
|
||||
resource
|
||||
});
|
||||
});
|
||||
}
|
||||
], (err, results) => {
|
||||
if(err) return callback(err);
|
||||
let loaders = results[0];
|
||||
const resourceResolveData = results[1].resourceResolveData;
|
||||
resource = results[1].resource;
|
||||
|
||||
// translate option idents
|
||||
try {
|
||||
loaders.forEach(item => {
|
||||
if(typeof item.options === "string" && /^\?/.test(item.options)) {
|
||||
item.options = this.ruleSet.findOptionsByIdent(item.options.substr(1));
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
return callback(e);
|
||||
}
|
||||
|
||||
if(resource === false) {
|
||||
// ignored
|
||||
return callback(null,
|
||||
new RawModule(
|
||||
"/* (ignored) */",
|
||||
`ignored ${context} ${request}`,
|
||||
`${request} (ignored)`
|
||||
)
|
||||
createdModule = new NormalModule(
|
||||
result.request,
|
||||
result.userRequest,
|
||||
result.rawRequest,
|
||||
result.loaders,
|
||||
result.resource,
|
||||
result.parser
|
||||
);
|
||||
}
|
||||
|
||||
const userRequest = loaders.map(loaderToIdent).concat([resource]).join("!");
|
||||
createdModule = this.applyPluginsWaterfall0("module", createdModule);
|
||||
|
||||
let resourcePath = resource;
|
||||
let resourceQuery = "";
|
||||
const queryIndex = resourcePath.indexOf("?");
|
||||
if(queryIndex >= 0) {
|
||||
resourceQuery = resourcePath.substr(queryIndex);
|
||||
resourcePath = resourcePath.substr(0, queryIndex);
|
||||
}
|
||||
return callback(null, createdModule);
|
||||
});
|
||||
});
|
||||
});
|
||||
this.plugin("resolver", () => (data, callback) => {
|
||||
const contextInfo = data.contextInfo;
|
||||
const context = data.context;
|
||||
const request = data.request;
|
||||
|
||||
const result = this.ruleSet.exec({
|
||||
resource: resourcePath,
|
||||
resourceQuery,
|
||||
issuer: contextInfo.issuer,
|
||||
compiler: contextInfo.compiler
|
||||
const noAutoLoaders = /^-?!/.test(request);
|
||||
const noPrePostAutoLoaders = /^!!/.test(request);
|
||||
const noPostAutoLoaders = /^-!/.test(request);
|
||||
let elements = request.replace(/^-?!+/, "").replace(/!!+/g, "!").split("!");
|
||||
let resource = elements.pop();
|
||||
elements = elements.map(identToLoaderRequest);
|
||||
|
||||
asyncLib.parallel([
|
||||
callback => this.resolveRequestArray(contextInfo, context, elements, this.resolvers.loader, callback),
|
||||
callback => {
|
||||
if(resource === "" || resource[0] === "?")
|
||||
return callback(null, {
|
||||
resource
|
||||
});
|
||||
|
||||
this.resolvers.normal.resolve(contextInfo, context, resource, (err, resource, resourceResolveData) => {
|
||||
if(err) return callback(err);
|
||||
callback(null, {
|
||||
resourceResolveData,
|
||||
resource
|
||||
});
|
||||
});
|
||||
const settings = {};
|
||||
const useLoadersPost = [];
|
||||
const useLoaders = [];
|
||||
const useLoadersPre = [];
|
||||
result.forEach(r => {
|
||||
if(r.type === "use") {
|
||||
if(r.enforce === "post" && !noPostAutoLoaders && !noPrePostAutoLoaders)
|
||||
useLoadersPost.push(r.value);
|
||||
else if(r.enforce === "pre" && !noPrePostAutoLoaders)
|
||||
useLoadersPre.push(r.value);
|
||||
else if(!r.enforce && !noAutoLoaders && !noPrePostAutoLoaders)
|
||||
useLoaders.push(r.value);
|
||||
} else {
|
||||
settings[r.type] = r.value;
|
||||
}
|
||||
], (err, results) => {
|
||||
if(err) return callback(err);
|
||||
let loaders = results[0];
|
||||
const resourceResolveData = results[1].resourceResolveData;
|
||||
resource = results[1].resource;
|
||||
|
||||
// translate option idents
|
||||
try {
|
||||
loaders.forEach(item => {
|
||||
if(typeof item.options === "string" && /^\?/.test(item.options)) {
|
||||
item.options = this.ruleSet.findOptionsByIdent(item.options.substr(1));
|
||||
}
|
||||
});
|
||||
asyncLib.parallel([
|
||||
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoadersPost, this.resolvers.loader),
|
||||
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoaders, this.resolvers.loader),
|
||||
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoadersPre, this.resolvers.loader)
|
||||
], (err, results) => {
|
||||
if(err) return callback(err);
|
||||
loaders = results[0].concat(loaders, results[1], results[2]);
|
||||
process.nextTick(() => {
|
||||
callback(null, {
|
||||
context: context,
|
||||
request: loaders.map(loaderToIdent).concat([resource]).join("!"),
|
||||
dependencies: data.dependencies,
|
||||
userRequest,
|
||||
rawRequest: request,
|
||||
loaders,
|
||||
resource,
|
||||
resourceResolveData,
|
||||
parser: this.getParser(settings.parser)
|
||||
});
|
||||
} catch(e) {
|
||||
return callback(e);
|
||||
}
|
||||
|
||||
if(resource === false) {
|
||||
// ignored
|
||||
return callback(null,
|
||||
new RawModule(
|
||||
"/* (ignored) */",
|
||||
`ignored ${context} ${request}`,
|
||||
`${request} (ignored)`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const userRequest = loaders.map(loaderToIdent).concat([resource]).join("!");
|
||||
|
||||
let resourcePath = resource;
|
||||
let resourceQuery = "";
|
||||
const queryIndex = resourcePath.indexOf("?");
|
||||
if(queryIndex >= 0) {
|
||||
resourceQuery = resourcePath.substr(queryIndex);
|
||||
resourcePath = resourcePath.substr(0, queryIndex);
|
||||
}
|
||||
|
||||
const result = this.ruleSet.exec({
|
||||
resource: resourcePath,
|
||||
resourceQuery,
|
||||
issuer: contextInfo.issuer,
|
||||
compiler: contextInfo.compiler
|
||||
});
|
||||
const settings = {};
|
||||
const useLoadersPost = [];
|
||||
const useLoaders = [];
|
||||
const useLoadersPre = [];
|
||||
result.forEach(r => {
|
||||
if(r.type === "use") {
|
||||
if(r.enforce === "post" && !noPostAutoLoaders && !noPrePostAutoLoaders)
|
||||
useLoadersPost.push(r.value);
|
||||
else if(r.enforce === "pre" && !noPrePostAutoLoaders)
|
||||
useLoadersPre.push(r.value);
|
||||
else if(!r.enforce && !noAutoLoaders && !noPrePostAutoLoaders)
|
||||
useLoaders.push(r.value);
|
||||
} else {
|
||||
settings[r.type] = r.value;
|
||||
}
|
||||
});
|
||||
asyncLib.parallel([
|
||||
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoadersPost, this.resolvers.loader),
|
||||
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoaders, this.resolvers.loader),
|
||||
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoadersPre, this.resolvers.loader)
|
||||
], (err, results) => {
|
||||
if(err) return callback(err);
|
||||
loaders = results[0].concat(loaders, results[1], results[2]);
|
||||
process.nextTick(() => {
|
||||
callback(null, {
|
||||
context: context,
|
||||
request: loaders.map(loaderToIdent).concat([resource]).join("!"),
|
||||
dependencies: data.dependencies,
|
||||
userRequest,
|
||||
rawRequest: request,
|
||||
loaders,
|
||||
resource,
|
||||
resourceResolveData,
|
||||
parser: this.getParser(settings.parser)
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1102,7 +1102,7 @@ class Parser extends Tapable {
|
|||
result = this.applyPluginsBailResult1("call " + callee.identifier, expression);
|
||||
if(result === true)
|
||||
return;
|
||||
let identifier = callee.identifier.replace(/\.[^\.]+$/, ".*");
|
||||
let identifier = callee.identifier.replace(/\.[^.]+$/, ".*");
|
||||
if(identifier !== callee.identifier) {
|
||||
result = this.applyPluginsBailResult1("call " + identifier, expression);
|
||||
if(result === true)
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class Stats {
|
|||
const showPublicPath = optionOrLocalFallback(options.publicPath, !forToString);
|
||||
const excludeModules = [].concat(optionOrFallback(options.exclude, [])).map(item => {
|
||||
if(typeof item === "string") {
|
||||
const regExp = new RegExp(`[\\\\/]${item.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")}([\\\\/]|$|!|\\?)`);
|
||||
const regExp = new RegExp(`[\\\\/]${item.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")}([\\\\/]|$|!|\\?)`); // eslint-disable-line no-useless-escape
|
||||
return ident => regExp.test(ident);
|
||||
}
|
||||
if(item && typeof item === "object" && typeof item.test === "function")
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ module.exports = class Template extends Tapable {
|
|||
|
||||
static toPath(str) {
|
||||
if(typeof str !== "string") return "";
|
||||
return str.replace(/[^a-zA-Z0-9_!§$()=\-\^°]+/g, "-").replace(/^-|-$/, "");
|
||||
return str.replace(/[^a-zA-Z0-9_!§$()=\-^°]+/g, "-").replace(/^-|-$/, "");
|
||||
}
|
||||
|
||||
// map number to a single character a-z, A-Z or <_ + number> if number is too big
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ HarmonyCompatibilityDependency.Template = class HarmonyExportDependencyTemplate
|
|||
const usedExports = dep.originModule.usedExports;
|
||||
if(usedExports && !Array.isArray(usedExports)) {
|
||||
const exportName = dep.originModule.exportsArgument || "exports";
|
||||
const content = `Object.defineProperty(${exportName}, \"__esModule\", { value: true });\n`;
|
||||
const content = `Object.defineProperty(${exportName}, "__esModule", { value: true });\n`;
|
||||
source.insert(-10, content);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,86 +31,80 @@ class AggressiveMergingPlugin {
|
|||
for(let i = 0; i < idx; i++) {
|
||||
const b = chunks[i];
|
||||
if(b.isInitial()) continue;
|
||||
combinations.push([b, a]);
|
||||
combinations.push({
|
||||
a,
|
||||
b,
|
||||
improvement: undefined
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
combinations.forEach((pair) => {
|
||||
const a = pair[0].size({
|
||||
const a = pair.b.size({
|
||||
chunkOverhead: 0
|
||||
});
|
||||
const b = pair[1].size({
|
||||
const b = pair.a.size({
|
||||
chunkOverhead: 0
|
||||
});
|
||||
const ab = pair[0].integratedSize(pair[1], {
|
||||
const ab = pair.b.integratedSize(pair.a, {
|
||||
chunkOverhead: 0
|
||||
});
|
||||
pair.push({
|
||||
a: a,
|
||||
b: b,
|
||||
ab: ab
|
||||
});
|
||||
let newSize;
|
||||
if(ab === false) {
|
||||
pair.unshift(false);
|
||||
pair.improvement = false;
|
||||
return;
|
||||
} else if(options.moveToParents) {
|
||||
const aOnly = ab - b;
|
||||
const bOnly = ab - a;
|
||||
const common = a + b - ab;
|
||||
newSize = common + getParentsWeight(pair[0]) * aOnly + getParentsWeight(pair[1]) * bOnly;
|
||||
pair.push({
|
||||
aOnly: aOnly,
|
||||
bOnly: bOnly,
|
||||
common: common,
|
||||
newSize: newSize
|
||||
});
|
||||
newSize = common + getParentsWeight(pair.b) * aOnly + getParentsWeight(pair.a) * bOnly;
|
||||
} else {
|
||||
newSize = ab;
|
||||
}
|
||||
|
||||
pair.unshift((a + b) / newSize);
|
||||
pair.improvement = (a + b) / newSize;
|
||||
});
|
||||
combinations = combinations.filter((pair) => {
|
||||
return pair[0] !== false;
|
||||
return pair.improvement !== false;
|
||||
});
|
||||
combinations.sort((a, b) => {
|
||||
return b[0] - a[0];
|
||||
return b.improvement - a.improvement;
|
||||
});
|
||||
|
||||
const pair = combinations[0];
|
||||
|
||||
if(!pair) return;
|
||||
if(pair[0] < minSizeReduce) return;
|
||||
if(pair.improvement < minSizeReduce) return;
|
||||
|
||||
if(options.moveToParents) {
|
||||
const commonModules = pair[1].modules.filter((m) => {
|
||||
return pair[2].modules.indexOf(m) >= 0;
|
||||
const commonModules = pair.b.modules.filter((m) => {
|
||||
return pair.a.modules.indexOf(m) >= 0;
|
||||
});
|
||||
const aOnlyModules = pair[1].modules.filter((m) => {
|
||||
const aOnlyModules = pair.b.modules.filter((m) => {
|
||||
return commonModules.indexOf(m) < 0;
|
||||
});
|
||||
const bOnlyModules = pair[2].modules.filter((m) => {
|
||||
const bOnlyModules = pair.a.modules.filter((m) => {
|
||||
return commonModules.indexOf(m) < 0;
|
||||
});
|
||||
aOnlyModules.forEach((m) => {
|
||||
pair[1].removeModule(m);
|
||||
m.removeChunk(pair[1]);
|
||||
pair[1].parents.forEach((c) => {
|
||||
pair.b.removeModule(m);
|
||||
m.removeChunk(pair.b);
|
||||
pair.b.parents.forEach((c) => {
|
||||
c.addModule(m);
|
||||
m.addChunk(c);
|
||||
});
|
||||
});
|
||||
bOnlyModules.forEach((m) => {
|
||||
pair[2].removeModule(m);
|
||||
m.removeChunk(pair[2]);
|
||||
pair[2].parents.forEach((c) => {
|
||||
pair.a.removeModule(m);
|
||||
m.removeChunk(pair.a);
|
||||
pair.a.parents.forEach((c) => {
|
||||
c.addModule(m);
|
||||
m.addChunk(c);
|
||||
});
|
||||
});
|
||||
}
|
||||
if(pair[1].integrate(pair[2], "aggressive-merge")) {
|
||||
chunks.splice(chunks.indexOf(pair[2]), 1);
|
||||
if(pair.b.integrate(pair.a, "aggressive-merge")) {
|
||||
chunks.splice(chunks.indexOf(pair.a), 1);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ The available options are:
|
|||
* that webpack will take care of loading this file.
|
||||
*/
|
||||
if(options.async && options.filename) {
|
||||
throw new Error(`You can not specify a filename if you use the \"async\" option.
|
||||
You can however specify the name of the async chunk by passing the desired string as the \"async\" option.`);
|
||||
throw new Error(`You can not specify a filename if you use the "async" option.
|
||||
You can however specify the name of the async chunk by passing the desired string as the "async" option.`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
"uglifyjs-webpack-plugin": "^0.4.6",
|
||||
"watchpack": "^1.4.0",
|
||||
"webpack-sources": "^1.0.1",
|
||||
"yargs": "^6.0.0"
|
||||
"yargs": "^8.0.2"
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
|
|
@ -39,11 +39,11 @@
|
|||
"coveralls": "^2.11.2",
|
||||
"css-loader": "^0.28.3",
|
||||
"es6-promise-polyfill": "^1.1.1",
|
||||
"eslint": "3.12.2",
|
||||
"eslint-plugin-node": "^3.0.5",
|
||||
"eslint": "^4.3.0",
|
||||
"eslint-plugin-node": "^5.1.1",
|
||||
"express": "~4.13.1",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^0.11.1",
|
||||
"file-loader": "^0.11.2",
|
||||
"i18n-webpack-plugin": "^0.3.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"jade": "^1.11.0",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
module.exports = function testAssertions(code, stdout, stderr) {
|
||||
code.should.not.eql(0);
|
||||
stdout.should.be.empty();
|
||||
stderr[0].should.containEql("Configuration with name \'foo\' was not found.");
|
||||
stderr[0].should.containEql("Configuration with name 'foo' was not found.");
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = function(source) {
|
||||
console.log('post-loaded ' + source.replace('\n', ''))
|
||||
console.log("post-loaded " + source.replace(/\r?\n/g, ""));
|
||||
return source;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = function(source) {
|
||||
console.log('pre-loaded ' + source.replace('\n', ''))
|
||||
console.log("pre-loaded " + source.replace(/\r?\n/g, ""));
|
||||
return source;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ module.exports = {
|
|||
return {
|
||||
loader: "./loader",
|
||||
options: {
|
||||
resource: data.resource.replace(/^.*[\\\/]/g, ""),
|
||||
resource: data.resource.replace(/^.*[\\/]/g, ""),
|
||||
resourceQuery: data.resourceQuery,
|
||||
issuer: data.issuer.replace(/^.*[\\\/]/g, ""),
|
||||
issuer: data.issuer.replace(/^.*[\\/]/g, ""),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ module.exports = {
|
|||
}
|
||||
const chunkModulesToName = (chunk) => chunk.mapModules((mod) => {
|
||||
const rs = new RequestShortener(mod.context);
|
||||
return rs.shorten(mod.request).replace(/[.\/\\]/g, "_");
|
||||
return rs.shorten(mod.request).replace(/[./\\]/g, "_");
|
||||
}).join("-");
|
||||
|
||||
if(chunk.getNumberOfModules() > 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue