mirror of https://github.com/webpack/webpack.git
commit
180f912493
|
@ -206,8 +206,8 @@ const tests = {
|
||||||
const suite = new Benchmark.Suite();
|
const suite = new Benchmark.Suite();
|
||||||
|
|
||||||
Object.keys(tests)
|
Object.keys(tests)
|
||||||
.filter(
|
.filter(name =>
|
||||||
name => (process.argv.length > 2 ? name.includes(process.argv[2]) : true)
|
process.argv.length > 2 ? name.includes(process.argv[2]) : true
|
||||||
)
|
)
|
||||||
.forEach(name => {
|
.forEach(name => {
|
||||||
const test = tests[name];
|
const test = tests[name];
|
||||||
|
|
|
@ -162,5 +162,7 @@ if (installedClis.length === 0) {
|
||||||
" and "
|
" and "
|
||||||
)} together. To work with the "webpack" command you need only one CLI package, please remove one of them or use them directly via their binary.`
|
)} together. To work with the "webpack" command you need only one CLI package, please remove one of them or use them directly via their binary.`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
process.exitCode = 1;
|
process.exitCode = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,8 +329,8 @@ interface RuleSetConditionsRecursive
|
||||||
extends Array<import("./declarations/WebpackOptions").RuleSetCondition> {}
|
extends Array<import("./declarations/WebpackOptions").RuleSetCondition> {}
|
||||||
interface RuleSetConditionsAbsoluteRecursive
|
interface RuleSetConditionsAbsoluteRecursive
|
||||||
extends Array<
|
extends Array<
|
||||||
import("./declarations/WebpackOptions").RuleSetConditionAbsolute
|
import("./declarations/WebpackOptions").RuleSetConditionAbsolute
|
||||||
> {}
|
> {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global variable declarations
|
* Global variable declarations
|
||||||
|
|
|
@ -15,7 +15,7 @@ export type Entry = EntryDynamic | EntryStatic;
|
||||||
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
||||||
* via the `definition` "EntryDynamic".
|
* via the `definition` "EntryDynamic".
|
||||||
*/
|
*/
|
||||||
export type EntryDynamic = (() => EntryStatic | Promise<EntryStatic>);
|
export type EntryDynamic = () => EntryStatic | Promise<EntryStatic>;
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
||||||
* via the `definition` "EntryStatic".
|
* via the `definition` "EntryStatic".
|
||||||
|
@ -237,12 +237,12 @@ export type RuleSetRules = RuleSetRule[];
|
||||||
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
||||||
* via the `definition` "OptimizationSplitChunksGetCacheGroups".
|
* via the `definition` "OptimizationSplitChunksGetCacheGroups".
|
||||||
*/
|
*/
|
||||||
export type OptimizationSplitChunksGetCacheGroups = ((
|
export type OptimizationSplitChunksGetCacheGroups = (
|
||||||
module: import("../lib/Module")
|
module: import("../lib/Module")
|
||||||
) =>
|
) =>
|
||||||
| OptimizationSplitChunksCacheGroup
|
| OptimizationSplitChunksCacheGroup
|
||||||
| OptimizationSplitChunksCacheGroup[]
|
| OptimizationSplitChunksCacheGroup[]
|
||||||
| void);
|
| void;
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
||||||
* via the `definition` "OptimizationSplitChunksSizes".
|
* via the `definition` "OptimizationSplitChunksSizes".
|
||||||
|
|
|
@ -11,9 +11,11 @@ export type BannerPluginArgument =
|
||||||
/**
|
/**
|
||||||
* The banner as function, it will be wrapped in a comment
|
* The banner as function, it will be wrapped in a comment
|
||||||
*/
|
*/
|
||||||
export type BannerFunction = (
|
export type BannerFunction = (data: {
|
||||||
data: {hash: string; chunk: import("../../lib/Chunk"); filename: string}
|
hash: string;
|
||||||
) => string;
|
chunk: import("../../lib/Chunk");
|
||||||
|
filename: string;
|
||||||
|
}) => string;
|
||||||
export type Rules = Rule[] | Rule;
|
export type Rules = Rule[] | Rule;
|
||||||
export type Rule = RegExp | string;
|
export type Rule = RegExp | string;
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@ export type IgnorePluginOptions =
|
||||||
/**
|
/**
|
||||||
* A filter function for context
|
* A filter function for context
|
||||||
*/
|
*/
|
||||||
checkContext?: ((context: string) => boolean);
|
checkContext?: (context: string) => boolean;
|
||||||
/**
|
/**
|
||||||
* A filter function for resource and context
|
* A filter function for resource and context
|
||||||
*/
|
*/
|
||||||
checkResource?: ((resource: string, context: string) => boolean);
|
checkResource?: (resource: string, context: string) => boolean;
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,11 +8,11 @@ export type ProgressPluginArgument = ProgressPluginOptions | HandlerFunction;
|
||||||
/**
|
/**
|
||||||
* Function that executes for every progress step
|
* Function that executes for every progress step
|
||||||
*/
|
*/
|
||||||
export type HandlerFunction = ((
|
export type HandlerFunction = (
|
||||||
percentage: number,
|
percentage: number,
|
||||||
msg: string,
|
msg: string,
|
||||||
...args: string[]
|
...args: string[]
|
||||||
) => void);
|
) => void;
|
||||||
|
|
||||||
export interface ProgressPluginOptions {
|
export interface ProgressPluginOptions {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -45,11 +45,10 @@ class AmdMainTemplatePlugin {
|
||||||
.filter(m => m instanceof ExternalModule);
|
.filter(m => m instanceof ExternalModule);
|
||||||
const externals = /** @type {ExternalModule[]} */ (modules);
|
const externals = /** @type {ExternalModule[]} */ (modules);
|
||||||
const externalsDepsArray = JSON.stringify(
|
const externalsDepsArray = JSON.stringify(
|
||||||
externals.map(
|
externals.map(m =>
|
||||||
m =>
|
typeof m.request === "object" && !Array.isArray(m.request)
|
||||||
typeof m.request === "object" && !Array.isArray(m.request)
|
? m.request.amd
|
||||||
? m.request.amd
|
: m.request
|
||||||
: m.request
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const externalsArguments = externals
|
const externalsArguments = externals
|
||||||
|
|
|
@ -991,8 +991,8 @@ class Compilation {
|
||||||
context: context
|
context: context
|
||||||
? context
|
? context
|
||||||
: originModule
|
: originModule
|
||||||
? originModule.context
|
? originModule.context
|
||||||
: this.compiler.context,
|
: this.compiler.context,
|
||||||
dependencies: dependencies
|
dependencies: dependencies
|
||||||
},
|
},
|
||||||
(err, result) => {
|
(err, result) => {
|
||||||
|
@ -1504,7 +1504,9 @@ class Compilation {
|
||||||
this.chunkGraph.connectChunkAndRuntimeModule(chunk, module);
|
this.chunkGraph.connectChunkAndRuntimeModule(chunk, module);
|
||||||
|
|
||||||
// Setup internals
|
// Setup internals
|
||||||
this.moduleGraph.getExportsInfo(module).setUsedForSideEffectsOnly();
|
const exportsInfo = this.moduleGraph.getExportsInfo(module);
|
||||||
|
exportsInfo.setHasProvideInfo();
|
||||||
|
exportsInfo.setUsedForSideEffectsOnly();
|
||||||
this.chunkGraph.addModuleRuntimeRequirements(module, [
|
this.chunkGraph.addModuleRuntimeRequirements(module, [
|
||||||
RuntimeGlobals.require
|
RuntimeGlobals.require
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -1323,8 +1323,8 @@ class JavascriptParser {
|
||||||
statement.kind === "const"
|
statement.kind === "const"
|
||||||
? this.hooks.varDeclarationConst
|
? this.hooks.varDeclarationConst
|
||||||
: statement.kind === "let"
|
: statement.kind === "let"
|
||||||
? this.hooks.varDeclarationLet
|
? this.hooks.varDeclarationLet
|
||||||
: this.hooks.varDeclarationVar;
|
: this.hooks.varDeclarationVar;
|
||||||
for (const declarator of statement.declarations) {
|
for (const declarator of statement.declarations) {
|
||||||
switch (declarator.type) {
|
switch (declarator.type) {
|
||||||
case "VariableDeclarator": {
|
case "VariableDeclarator": {
|
||||||
|
|
|
@ -19,9 +19,8 @@ const stringifySafe = data => {
|
||||||
return undefined; // Invalid JSON
|
return undefined; // Invalid JSON
|
||||||
}
|
}
|
||||||
|
|
||||||
return stringified.replace(
|
return stringified.replace(/\u2028|\u2029/g, str =>
|
||||||
/\u2028|\u2029/g,
|
str === "\u2029" ? "\\u2029" : "\\u2028"
|
||||||
str => (str === "\u2029" ? "\\u2029" : "\\u2028")
|
|
||||||
); // invalid in JavaScript but valid JSON
|
); // invalid in JavaScript but valid JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -123,10 +123,10 @@ class RuntimeTemplate {
|
||||||
moduleId === null
|
moduleId === null
|
||||||
? JSON.stringify("Module is not available (weak dependency)")
|
? JSON.stringify("Module is not available (weak dependency)")
|
||||||
: idExpr
|
: idExpr
|
||||||
? `"Module '" + ${idExpr} + "' is not available (weak dependency)"`
|
? `"Module '" + ${idExpr} + "' is not available (weak dependency)"`
|
||||||
: JSON.stringify(
|
: JSON.stringify(
|
||||||
`Module '${moduleId}' is not available (weak dependency)`
|
`Module '${moduleId}' is not available (weak dependency)`
|
||||||
);
|
);
|
||||||
const comment = request ? Template.toNormalComment(request) + " " : "";
|
const comment = request ? Template.toNormalComment(request) + " " : "";
|
||||||
const errorStatements =
|
const errorStatements =
|
||||||
`var e = new Error(${errorMessage}); ` +
|
`var e = new Error(${errorMessage}); ` +
|
||||||
|
|
|
@ -252,12 +252,12 @@ class UmdMainTemplatePlugin {
|
||||||
amdFactory +
|
amdFactory +
|
||||||
");\n"
|
");\n"
|
||||||
: this.names.amd && this.namedDefine === true
|
: this.names.amd && this.namedDefine === true
|
||||||
? " define(" +
|
? " define(" +
|
||||||
libraryName(this.names.amd) +
|
libraryName(this.names.amd) +
|
||||||
", [], " +
|
", [], " +
|
||||||
amdFactory +
|
amdFactory +
|
||||||
");\n"
|
");\n"
|
||||||
: " define([], " + amdFactory + ");\n") +
|
: " define([], " + amdFactory + ");\n") +
|
||||||
(this.names.root || this.names.commonjs
|
(this.names.root || this.names.commonjs
|
||||||
? getAuxilaryComment("commonjs") +
|
? getAuxilaryComment("commonjs") +
|
||||||
" else if(typeof exports === 'object')\n" +
|
" else if(typeof exports === 'object')\n" +
|
||||||
|
|
|
@ -19,8 +19,8 @@ class IgnoringWatchFileSystem {
|
||||||
|
|
||||||
watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) {
|
watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) {
|
||||||
const ignored = path =>
|
const ignored = path =>
|
||||||
this.paths.some(
|
this.paths.some(p =>
|
||||||
p => (p instanceof RegExp ? p.test(path) : path.indexOf(p) === 0)
|
p instanceof RegExp ? p.test(path) : path.indexOf(p) === 0
|
||||||
);
|
);
|
||||||
|
|
||||||
const notIgnored = path => !ignored(path);
|
const notIgnored = path => !ignored(path);
|
||||||
|
|
|
@ -273,10 +273,10 @@ class WebpackOptionsApply extends OptionsApply {
|
||||||
"MappingURL=[url]\n//# source" +
|
"MappingURL=[url]\n//# source" +
|
||||||
"MappingURL=[url]\n*/"
|
"MappingURL=[url]\n*/"
|
||||||
: legacy
|
: legacy
|
||||||
? "\n/*\n//@ source" + "MappingURL=[url]\n*/"
|
? "\n/*\n//@ source" + "MappingURL=[url]\n*/"
|
||||||
: modern
|
: modern
|
||||||
? "\n//# source" + "MappingURL=[url]"
|
? "\n//# source" + "MappingURL=[url]"
|
||||||
: null;
|
: null;
|
||||||
const Plugin = evalWrapped
|
const Plugin = evalWrapped
|
||||||
? EvalSourceMapDevToolPlugin
|
? EvalSourceMapDevToolPlugin
|
||||||
: SourceMapDevToolPlugin;
|
: SourceMapDevToolPlugin;
|
||||||
|
@ -298,10 +298,10 @@ class WebpackOptionsApply extends OptionsApply {
|
||||||
legacy && modern
|
legacy && modern
|
||||||
? "\n//@ sourceURL=[url]\n//# sourceURL=[url]"
|
? "\n//@ sourceURL=[url]\n//# sourceURL=[url]"
|
||||||
: legacy
|
: legacy
|
||||||
? "\n//@ sourceURL=[url]"
|
? "\n//@ sourceURL=[url]"
|
||||||
: modern
|
: modern
|
||||||
? "\n//# sourceURL=[url]"
|
? "\n//# sourceURL=[url]"
|
||||||
: null;
|
: null;
|
||||||
new EvalDevToolModulePlugin({
|
new EvalDevToolModulePlugin({
|
||||||
sourceUrlComment: comment,
|
sourceUrlComment: comment,
|
||||||
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
||||||
|
|
|
@ -35,10 +35,8 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
|
||||||
|
|
||||||
this.set("entry", "./src");
|
this.set("entry", "./src");
|
||||||
|
|
||||||
this.set(
|
this.set("devtool", "make", options =>
|
||||||
"devtool",
|
options.mode === "development" ? "eval" : false
|
||||||
"make",
|
|
||||||
options => (options.mode === "development" ? "eval" : false)
|
|
||||||
);
|
);
|
||||||
this.set("cache", "call", (value, options) => {
|
this.set("cache", "call", (value, options) => {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
@ -239,10 +237,8 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
|
||||||
});
|
});
|
||||||
this.set("performance.maxAssetSize", 250000);
|
this.set("performance.maxAssetSize", 250000);
|
||||||
this.set("performance.maxEntrypointSize", 250000);
|
this.set("performance.maxEntrypointSize", 250000);
|
||||||
this.set(
|
this.set("performance.hints", "make", options =>
|
||||||
"performance.hints",
|
isProductionLikeMode(options) ? "warning" : false
|
||||||
"make",
|
|
||||||
options => (isProductionLikeMode(options) ? "warning" : false)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.set("optimization", "call", value => Object.assign({}, value));
|
this.set("optimization", "call", value => Object.assign({}, value));
|
||||||
|
|
|
@ -102,11 +102,14 @@ class IdleFileCachePlugin {
|
||||||
};
|
};
|
||||||
let idleTimer = undefined;
|
let idleTimer = undefined;
|
||||||
compiler.cache.hooks.beginIdle.tap("IdleFileCachePlugin", () => {
|
compiler.cache.hooks.beginIdle.tap("IdleFileCachePlugin", () => {
|
||||||
idleTimer = setTimeout(() => {
|
idleTimer = setTimeout(
|
||||||
idleTimer = undefined;
|
() => {
|
||||||
isIdle = true;
|
idleTimer = undefined;
|
||||||
resolvedPromise.then(processIdleTasks);
|
isIdle = true;
|
||||||
}, isInitialStore ? idleTimeoutForInitialStore : idleTimeout);
|
resolvedPromise.then(processIdleTasks);
|
||||||
|
},
|
||||||
|
isInitialStore ? idleTimeoutForInitialStore : idleTimeout
|
||||||
|
);
|
||||||
idleTimer.unref();
|
idleTimer.unref();
|
||||||
});
|
});
|
||||||
compiler.cache.hooks.endIdle.tap("IdleFileCachePlugin", () => {
|
compiler.cache.hooks.endIdle.tap("IdleFileCachePlugin", () => {
|
||||||
|
|
|
@ -776,20 +776,20 @@ module.exports = class SplitChunksPlugin {
|
||||||
cacheGroupSource.minChunks !== undefined
|
cacheGroupSource.minChunks !== undefined
|
||||||
? cacheGroupSource.minChunks
|
? cacheGroupSource.minChunks
|
||||||
: cacheGroupSource.enforce
|
: cacheGroupSource.enforce
|
||||||
? 1
|
? 1
|
||||||
: this.options.minChunks,
|
: this.options.minChunks,
|
||||||
maxAsyncRequests:
|
maxAsyncRequests:
|
||||||
cacheGroupSource.maxAsyncRequests !== undefined
|
cacheGroupSource.maxAsyncRequests !== undefined
|
||||||
? cacheGroupSource.maxAsyncRequests
|
? cacheGroupSource.maxAsyncRequests
|
||||||
: cacheGroupSource.enforce
|
: cacheGroupSource.enforce
|
||||||
? Infinity
|
? Infinity
|
||||||
: this.options.maxAsyncRequests,
|
: this.options.maxAsyncRequests,
|
||||||
maxInitialRequests:
|
maxInitialRequests:
|
||||||
cacheGroupSource.maxInitialRequests !== undefined
|
cacheGroupSource.maxInitialRequests !== undefined
|
||||||
? cacheGroupSource.maxInitialRequests
|
? cacheGroupSource.maxInitialRequests
|
||||||
: cacheGroupSource.enforce
|
: cacheGroupSource.enforce
|
||||||
? Infinity
|
? Infinity
|
||||||
: this.options.maxInitialRequests,
|
: this.options.maxInitialRequests,
|
||||||
getName:
|
getName:
|
||||||
cacheGroupSource.getName !== undefined
|
cacheGroupSource.getName !== undefined
|
||||||
? cacheGroupSource.getName
|
? cacheGroupSource.getName
|
||||||
|
@ -934,11 +934,11 @@ module.exports = class SplitChunksPlugin {
|
||||||
const maxRequests = chunk.isOnlyInitial()
|
const maxRequests = chunk.isOnlyInitial()
|
||||||
? item.cacheGroup.maxInitialRequests
|
? item.cacheGroup.maxInitialRequests
|
||||||
: chunk.canBeInitial()
|
: chunk.canBeInitial()
|
||||||
? Math.min(
|
? Math.min(
|
||||||
item.cacheGroup.maxInitialRequests,
|
item.cacheGroup.maxInitialRequests,
|
||||||
item.cacheGroup.maxAsyncRequests
|
item.cacheGroup.maxAsyncRequests
|
||||||
)
|
)
|
||||||
: item.cacheGroup.maxAsyncRequests;
|
: item.cacheGroup.maxAsyncRequests;
|
||||||
return (
|
return (
|
||||||
!isFinite(maxRequests) || getRequests(chunk) < maxRequests
|
!isFinite(maxRequests) || getRequests(chunk) < maxRequests
|
||||||
);
|
);
|
||||||
|
|
|
@ -147,23 +147,20 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
|
||||||
`return Object.prototype.hasOwnProperty.call(staticMapping, chunkId) ? staticMapping[chunkId] : ${url};`
|
`return Object.prototype.hasOwnProperty.call(staticMapping, chunkId) ? staticMapping[chunkId] : ${url};`
|
||||||
]
|
]
|
||||||
: staticUrls.size > 0
|
: staticUrls.size > 0
|
||||||
? [
|
? [
|
||||||
// if is shorter for 1 - 15 cases
|
// if is shorter for 1 - 15 cases
|
||||||
// it minimizes to `x===1?"...":x===2?"...":"..."`
|
// it minimizes to `x===1?"...":x===2?"...":"..."`
|
||||||
"// return url for filenames not based on template",
|
"// return url for filenames not based on template",
|
||||||
Template.asString(
|
Template.asString(
|
||||||
Array.from(staticUrls).map(
|
Array.from(staticUrls).map(
|
||||||
([id, url]) =>
|
([id, url]) =>
|
||||||
`if(chunkId === ${JSON.stringify(id)}) return ${url};`
|
`if(chunkId === ${JSON.stringify(id)}) return ${url};`
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
"// return url for filenames based on template",
|
"// return url for filenames based on template",
|
||||||
`return ${url};`
|
`return ${url};`
|
||||||
]
|
]
|
||||||
: [
|
: ["// return url for filenames based on template", `return ${url};`]
|
||||||
"// return url for filenames based on template",
|
|
||||||
`return ${url};`
|
|
||||||
]
|
|
||||||
),
|
),
|
||||||
"};"
|
"};"
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -67,25 +67,24 @@ class StartupChunkDependenciesRuntimeModule extends RuntimeModule {
|
||||||
chunkIds[0]
|
chunkIds[0]
|
||||||
)}).then(next);`
|
)}).then(next);`
|
||||||
: chunkIds.length > 2
|
: chunkIds.length > 2
|
||||||
? Template.asString([
|
? Template.asString([
|
||||||
// using map is shorter for 3 or more chunks
|
// using map is shorter for 3 or more chunks
|
||||||
`return Promise.all(${JSON.stringify(chunkIds)}.map(${
|
`return Promise.all(${JSON.stringify(chunkIds)}.map(${
|
||||||
RuntimeGlobals.ensureChunk
|
RuntimeGlobals.ensureChunk
|
||||||
}, __webpack_require__)).then(next);`
|
}, __webpack_require__)).then(next);`
|
||||||
])
|
])
|
||||||
: Template.asString([
|
: Template.asString([
|
||||||
// calling ensureChunk directly is shorter for 0 - 2 chunks
|
// calling ensureChunk directly is shorter for 0 - 2 chunks
|
||||||
"return Promise.all([",
|
"return Promise.all([",
|
||||||
Template.indent(
|
Template.indent(
|
||||||
chunkIds
|
chunkIds
|
||||||
.map(
|
.map(
|
||||||
id =>
|
id => `${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)})`
|
||||||
`${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)})`
|
)
|
||||||
)
|
.join(",\n")
|
||||||
.join(",\n")
|
),
|
||||||
),
|
"]).then(next);"
|
||||||
"]).then(next);"
|
])
|
||||||
])
|
|
||||||
]),
|
]),
|
||||||
"}"
|
"}"
|
||||||
]);
|
]);
|
||||||
|
|
33
package.json
33
package.json
|
@ -24,37 +24,36 @@
|
||||||
"micromatch": "^3.1.8",
|
"micromatch": "^3.1.8",
|
||||||
"mkdirp": "~0.5.0",
|
"mkdirp": "~0.5.0",
|
||||||
"neo-async": "^2.5.0",
|
"neo-async": "^2.5.0",
|
||||||
"schema-utils": "^0.4.4",
|
"schema-utils": "^1.0.0",
|
||||||
"tapable": "^1.1.0",
|
"tapable": "^1.1.0",
|
||||||
"terser-webpack-plugin": "^1.2.1",
|
"terser-webpack-plugin": "^1.2.1",
|
||||||
"watchpack": "2.0.0-beta.2",
|
"watchpack": "2.0.0-beta.2",
|
||||||
"webpack-sources": "2.0.0-beta.1"
|
"webpack-sources": "2.0.0-beta.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^10.12.3",
|
"@types/node": "^10.12.21",
|
||||||
"@types/tapable": "^1.0.1",
|
"@types/tapable": "^1.0.1",
|
||||||
"benchmark": "^2.1.1",
|
"benchmark": "^2.1.1",
|
||||||
"bundle-loader": "~0.5.0",
|
"bundle-loader": "~0.5.0",
|
||||||
"codacy-coverage": "^3.1.0",
|
|
||||||
"coffee-loader": "^0.9.0",
|
"coffee-loader": "^0.9.0",
|
||||||
"coffeescript": "^1.10.0",
|
"coffeescript": "^2.3.2",
|
||||||
"coveralls": "^3.0.2",
|
"coveralls": "^3.0.2",
|
||||||
"css-loader": "^0.28.3",
|
"css-loader": "^2.1.0",
|
||||||
"es6-promise-polyfill": "^1.1.1",
|
"es6-promise-polyfill": "^1.1.1",
|
||||||
"eslint": "^5.8.0",
|
"eslint": "^5.8.0",
|
||||||
"eslint-config-prettier": "^3.1.0",
|
"eslint-config-prettier": "^4.0.0",
|
||||||
"eslint-plugin-jest": "^21.26.2",
|
"eslint-plugin-jest": "^22.2.2",
|
||||||
"eslint-plugin-node": "^8.0.0",
|
"eslint-plugin-node": "^8.0.0",
|
||||||
"eslint-plugin-prettier": "^3.0.0",
|
"eslint-plugin-prettier": "^3.0.0",
|
||||||
"file-loader": "^1.1.6",
|
"file-loader": "^3.0.1",
|
||||||
"glob": "^7.1.3",
|
"glob": "^7.1.3",
|
||||||
"husky": "^1.1.3",
|
"husky": "^1.1.3",
|
||||||
"istanbul": "^0.4.5",
|
"istanbul": "^0.4.5",
|
||||||
"jest": "24.0.0-alpha.1",
|
"jest": "24.1.0",
|
||||||
"jest-junit": "^5.2.0",
|
"jest-junit": "^6.2.1",
|
||||||
"json-loader": "^0.5.7",
|
"json-loader": "^0.5.7",
|
||||||
"json-schema-to-typescript": "^6.0.1",
|
"json-schema-to-typescript": "^6.0.1",
|
||||||
"less": "^2.5.1",
|
"less": "^3.9.0",
|
||||||
"less-loader": "^4.0.3",
|
"less-loader": "^4.0.3",
|
||||||
"lint-staged": "^8.0.4",
|
"lint-staged": "^8.0.4",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
|
@ -62,15 +61,15 @@
|
||||||
"pretty-format": "24.0.0-alpha.1",
|
"pretty-format": "24.0.0-alpha.1",
|
||||||
"pug": "^2.0.3",
|
"pug": "^2.0.3",
|
||||||
"pug-loader": "^2.4.0",
|
"pug-loader": "^2.4.0",
|
||||||
"raw-loader": "~0.5.0",
|
"raw-loader": "^1.0.0",
|
||||||
"react": "^15.2.1",
|
"react": "^16.8.0",
|
||||||
"react-dom": "^15.2.1",
|
"react-dom": "^16.8.0",
|
||||||
"rimraf": "^2.6.2",
|
"rimraf": "^2.6.2",
|
||||||
"script-loader": "~0.7.0",
|
"script-loader": "~0.7.0",
|
||||||
"simple-git": "^1.65.0",
|
"simple-git": "^1.65.0",
|
||||||
"style-loader": "^0.19.1",
|
"style-loader": "^0.23.1",
|
||||||
"typescript": "^3.2.2",
|
"typescript": "^3.2.2",
|
||||||
"url-loader": "^0.6.2",
|
"url-loader": "^1.1.2",
|
||||||
"wast-loader": "^1.5.5",
|
"wast-loader": "^1.5.5",
|
||||||
"worker-loader": "^2.0.0",
|
"worker-loader": "^2.0.0",
|
||||||
"xxhashjs": "^0.2.1"
|
"xxhashjs": "^0.2.1"
|
||||||
|
@ -98,7 +97,7 @@
|
||||||
"test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest",
|
"test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest",
|
||||||
"test:update-snapshots": "yarn jest -u",
|
"test:update-snapshots": "yarn jest -u",
|
||||||
"test:integration": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.test.js\"",
|
"test:integration": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.test.js\"",
|
||||||
"test:basic": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/{TestCasesNormal,StatsTestCases,ConfigTestCases}.test.js\"",
|
"test:basic": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/te{st/TestCasesNormal,st/StatsTestCases,st/ConfigTestCases}.test.js\"",
|
||||||
"test:unit": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\"",
|
"test:unit": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\"",
|
||||||
"travis:integration": "yarn cover:init && yarn cover:integration --ci $JEST",
|
"travis:integration": "yarn cover:init && yarn cover:integration --ci $JEST",
|
||||||
"travis:basic": "yarn test:basic --ci $JEST",
|
"travis:basic": "yarn test:basic --ci $JEST",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/* globals describe expect it beforeAll */
|
/* globals describe expect it */
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const vm = require("vm");
|
const vm = require("vm");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/* globals expect fit */
|
/* globals expect */
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const vm = require("vm");
|
const vm = require("vm");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* globals describe, it, beforeEach, afterEach */
|
/* globals describe it beforeEach */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const NormalModule = require("../lib/NormalModule");
|
const NormalModule = require("../lib/NormalModule");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* globals describe, it, beforeEach */
|
/* globals describe it */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { formatSize } = require("../lib/SizeFormatHelpers");
|
const { formatSize } = require("../lib/SizeFormatHelpers");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* global describe it beforeAll expect */
|
/* global describe it expect */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* global beforeAll expect fit */
|
/* global beforeAll expect */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
|
@ -738,9 +738,9 @@ Entrypoint main = main.js
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`StatsTestCases should print correct stats for filter-warnings 1`] = `
|
exports[`StatsTestCases should print correct stats for filter-warnings 1`] = `
|
||||||
"Hash: 2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f2f5b15eaf2a1fb80a33f
|
"Hash: a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586a10789627d1863900586
|
||||||
Child undefined:
|
Child undefined:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
|
@ -770,49 +770,49 @@ Child undefined:
|
||||||
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
||||||
|
|
||||||
Child Terser:
|
Child Terser:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
bundle.js 1.32 KiB {404} [emitted] main
|
bundle.js 1.32 KiB {404} [emitted] main
|
||||||
Entrypoint main = bundle.js
|
Entrypoint main = bundle.js
|
||||||
Child /Terser/:
|
Child /Terser/:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
bundle.js 1.32 KiB {404} [emitted] main
|
bundle.js 1.32 KiB {404} [emitted] main
|
||||||
Entrypoint main = bundle.js
|
Entrypoint main = bundle.js
|
||||||
Child warnings => true:
|
Child warnings => true:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
bundle.js 1.32 KiB {404} [emitted] main
|
bundle.js 1.32 KiB {404} [emitted] main
|
||||||
Entrypoint main = bundle.js
|
Entrypoint main = bundle.js
|
||||||
Child [Terser]:
|
Child [Terser]:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
bundle.js 1.32 KiB {404} [emitted] main
|
bundle.js 1.32 KiB {404} [emitted] main
|
||||||
Entrypoint main = bundle.js
|
Entrypoint main = bundle.js
|
||||||
Child [/Terser/]:
|
Child [/Terser/]:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
bundle.js 1.32 KiB {404} [emitted] main
|
bundle.js 1.32 KiB {404} [emitted] main
|
||||||
Entrypoint main = bundle.js
|
Entrypoint main = bundle.js
|
||||||
Child [warnings => true]:
|
Child [warnings => true]:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
bundle.js 1.32 KiB {404} [emitted] main
|
bundle.js 1.32 KiB {404} [emitted] main
|
||||||
Entrypoint main = bundle.js
|
Entrypoint main = bundle.js
|
||||||
Child should not filter:
|
Child should not filter:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
|
@ -842,7 +842,7 @@ Child should not filter:
|
||||||
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
||||||
|
|
||||||
Child /should not filter/:
|
Child /should not filter/:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
|
@ -872,7 +872,7 @@ Child /should not filter/:
|
||||||
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
||||||
|
|
||||||
Child warnings => false:
|
Child warnings => false:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
|
@ -902,7 +902,7 @@ Child warnings => false:
|
||||||
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
||||||
|
|
||||||
Child [should not filter]:
|
Child [should not filter]:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
|
@ -932,7 +932,7 @@ Child [should not filter]:
|
||||||
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
||||||
|
|
||||||
Child [/should not filter/]:
|
Child [/should not filter/]:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
|
@ -962,7 +962,7 @@ Child [/should not filter/]:
|
||||||
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
WARNING in Terser Plugin: Dropping unused function someUnUsedFunction5 [./index.js:12,0]
|
||||||
|
|
||||||
Child [warnings => false]:
|
Child [warnings => false]:
|
||||||
Hash: 2f5b15eaf2a1fb80a33f
|
Hash: a10789627d1863900586
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
|
@ -3460,7 +3460,7 @@ Entrypoint main = bundle.js
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`StatsTestCases should print correct stats for warnings-terser 1`] = `
|
exports[`StatsTestCases should print correct stats for warnings-terser 1`] = `
|
||||||
"Hash: a1c39c4e43eb7943bde9
|
"Hash: 498ee970af2d984c0084
|
||||||
Time: Xms
|
Time: Xms
|
||||||
Built at: Thu Jan 01 1970 00:00:00 GMT
|
Built at: Thu Jan 01 1970 00:00:00 GMT
|
||||||
Asset Size Chunks Chunk Names
|
Asset Size Chunks Chunk Names
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
export { process };
|
const p = process;
|
||||||
|
export { p as process };
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* globals describe, beforeEach, it */
|
/* globals describe it */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const identifierUtil = require("../lib/util/identifier");
|
const identifierUtil = require("../lib/util/identifier");
|
||||||
|
|
Loading…
Reference in New Issue