mirror of https://github.com/webpack/webpack.git
advanced module type refactoring
added json type .mjs default to javascript/esm type adjusted parser plugins to react on module type
This commit is contained in:
parent
65e855c636
commit
00f2b5ede7
|
@ -32,7 +32,7 @@ class APIPlugin {
|
|||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", parser => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], parser => {
|
||||
Object.keys(REPLACEMENTS).forEach(key => {
|
||||
parser.plugin(`expression ${key}`, ParserHelpers.toConstantDependency(REPLACEMENTS[key]));
|
||||
parser.plugin(`evaluate typeof ${key}`, ParserHelpers.evaluateToString(REPLACEMENT_TYPES[key]));
|
||||
|
|
|
@ -8,9 +8,6 @@ const ConstDependency = require("./dependencies/ConstDependency");
|
|||
|
||||
const NullFactory = require("./NullFactory");
|
||||
|
||||
const jsonLoaderPath = require.resolve("json-loader");
|
||||
const matchJson = /\.json$/i;
|
||||
|
||||
class CompatibilityPlugin {
|
||||
|
||||
apply(compiler) {
|
||||
|
@ -18,7 +15,7 @@ class CompatibilityPlugin {
|
|||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin("parser javascript/auto", (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.browserify !== "undefined" && !parserOptions.browserify)
|
||||
return;
|
||||
|
@ -40,17 +37,6 @@ class CompatibilityPlugin {
|
|||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
params.normalModuleFactory.plugin("after-resolve", (data, done) => {
|
||||
// if this is a json file and there are no loaders active, we use the json-loader in order to avoid parse errors
|
||||
// @see https://github.com/webpack/webpack/issues/3363
|
||||
if(matchJson.test(data.request) && data.loaders.length === 0) {
|
||||
data.loaders.push({
|
||||
loader: jsonLoaderPath
|
||||
});
|
||||
}
|
||||
done(null, data);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class ConstPlugin {
|
|||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", parser => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], parser => {
|
||||
parser.plugin("statement if", statement => {
|
||||
const param = parser.evaluateExpression(statement.test);
|
||||
const bool = param.asBool();
|
||||
|
|
|
@ -36,7 +36,7 @@ class DefinePlugin {
|
|||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], (parser) => {
|
||||
const walkDefinitions = (definitions, prefix) => {
|
||||
Object.keys(definitions).forEach((key) => {
|
||||
const code = definitions[key];
|
||||
|
|
|
@ -36,7 +36,7 @@ class ExtendedAPIPlugin {
|
|||
});
|
||||
mainTemplate.plugin("global-hash", () => true);
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], (parser, parserOptions) => {
|
||||
Object.keys(REPLACEMENTS).forEach(key => {
|
||||
parser.plugin(`expression ${key}`, ParserHelpers.toConstantDependency(REPLACEMENTS[key]));
|
||||
parser.plugin(`evaluate typeof ${key}`, ParserHelpers.evaluateToString(REPLACEMENT_TYPES[key]));
|
||||
|
|
|
@ -11,12 +11,19 @@ class FunctionModuleTemplatePlugin {
|
|||
apply(moduleTemplate) {
|
||||
moduleTemplate.plugin("render", (moduleSource, module) => {
|
||||
const source = new ConcatSource();
|
||||
const defaultArguments = [module.moduleArgument || "module", module.exportsArgument || "exports"];
|
||||
const args = [module.moduleArgument];
|
||||
// TODO remove HACK checking type for javascript
|
||||
if(!module.type || !module.type.startsWith("javascript") || (module.arguments && module.arguments.length !== 0) || module.hasDependencies(d => d.requireWebpackRequire !== false)) {
|
||||
defaultArguments.push("__webpack_require__");
|
||||
if(module.type && module.type.startsWith("javascript")) {
|
||||
args.push(module.exportsArgument);
|
||||
if(module.hasDependencies(d => d.requireWebpackRequire !== false)) {
|
||||
args.push("__webpack_require__");
|
||||
}
|
||||
source.add("/***/ (function(" + defaultArguments.concat(module.arguments || []).join(", ") + ") {\n\n");
|
||||
} else if(module.type && module.type.startsWith("json")) {
|
||||
// no additional arguments needed
|
||||
} else {
|
||||
args.push(module.exportsArgument, "__webpack_require__");
|
||||
}
|
||||
source.add("/***/ (function(" + args.join(", ") + ") {\n\n");
|
||||
if(module.strict) source.add("\"use strict\";\n");
|
||||
source.add(moduleSource);
|
||||
source.add("\n\n/***/ })");
|
||||
|
|
|
@ -190,7 +190,8 @@ module.exports = class HotModuleReplacementPlugin {
|
|||
]);
|
||||
});
|
||||
|
||||
normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
// TODO add HMR support for javascript/esm
|
||||
normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
parser.plugin("expression __webpack_hash__", ParserHelpers.toConstantDependency("__webpack_require__.h()"));
|
||||
parser.plugin("evaluate typeof __webpack_hash__", ParserHelpers.evaluateToString("string"));
|
||||
parser.plugin("evaluate Identifier module.hot", expr => {
|
||||
|
|
|
@ -8,8 +8,10 @@ const Parser = require("./Parser");
|
|||
|
||||
class JavascriptModulesPlugin {
|
||||
apply(compiler) {
|
||||
compiler.plugin("compilation", (compilation, { normalModuleFactory }) => {
|
||||
normalModuleFactory.plugin(["create-parser javascript/auto", "create-parser javascript/esm"], () => {
|
||||
compiler.plugin("compilation", (compilation, {
|
||||
normalModuleFactory
|
||||
}) => {
|
||||
normalModuleFactory.plugin(["create-parser javascript/auto", "create-parser javascript/dynamic", "create-parser javascript/esm"], () => {
|
||||
return new Parser();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const JsonParser = require("./JsonParser");
|
||||
const ConcatSource = require("webpack-sources").ConcatSource;
|
||||
|
||||
class JsonModulesPlugin {
|
||||
apply(compiler) {
|
||||
compiler.plugin("compilation", (compilation, {
|
||||
normalModuleFactory
|
||||
}) => {
|
||||
normalModuleFactory.plugin("create-parser json", () => {
|
||||
return new JsonParser();
|
||||
});
|
||||
compilation.moduleTemplates.javascript.plugin("content", (moduleSource, module) => {
|
||||
if(module.type && module.type.startsWith("json")) {
|
||||
const source = new ConcatSource();
|
||||
source.add(`${module.moduleArgument}.exports = `);
|
||||
source.add(moduleSource);
|
||||
return source;
|
||||
} else {
|
||||
return moduleSource;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = JsonModulesPlugin;
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const ConstDependency = require("./dependencies/ConstDependency");
|
||||
|
||||
class JsonParser {
|
||||
constructor(options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
parse(source, state) {
|
||||
const regExp = /\u2028|\u2029/g; // invalid in JavaScript but valid JSON
|
||||
let match = regExp.exec(source);
|
||||
while(match) {
|
||||
const escaped = match[0] === "\u2028" ? "\\u2028" : "\\u2029";
|
||||
const dep = new ConstDependency(escaped, [match.index, match.index]);
|
||||
state.module.addDependency(dep);
|
||||
match = regExp.exec(source);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = JsonParser;
|
|
@ -79,7 +79,7 @@ class LibraryTemplatePlugin {
|
|||
}));
|
||||
break;
|
||||
case "jsonp":
|
||||
var JsonpExportMainTemplatePlugin = require("./JsonpExportMainTemplatePlugin");
|
||||
var JsonpExportMainTemplatePlugin = require("./web/JsonpExportMainTemplatePlugin");
|
||||
compilation.apply(new JsonpExportMainTemplatePlugin(this.name));
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -59,8 +59,8 @@ class Module extends DependenciesBlock {
|
|||
this.errors = [];
|
||||
this.strict = false;
|
||||
this.meta = {};
|
||||
this.exportsArgument = undefined;
|
||||
this.moduleArgument = undefined;
|
||||
this.exportsArgument = "exports";
|
||||
this.moduleArgument = "module";
|
||||
this.assets = null;
|
||||
this.fileDependencies = undefined;
|
||||
this.contextDependencies = undefined;
|
||||
|
@ -261,6 +261,14 @@ class Module extends DependenciesBlock {
|
|||
unbuild() {
|
||||
this.disconnect();
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
throw new Error("Module.arguments was removed, there is no replacement.");
|
||||
}
|
||||
|
||||
set arguments(value) {
|
||||
throw new Error("Module.arguments was removed, there is no replacement.");
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(Module.prototype, "entry", {
|
||||
|
|
|
@ -13,7 +13,8 @@ module.exports = class ModuleTemplate extends Template {
|
|||
|
||||
render(module, dependencyTemplates, options) {
|
||||
const moduleSource = module.source(dependencyTemplates, this.outputOptions, this.requestShortener);
|
||||
const moduleSourcePostModule = this.applyPluginsWaterfall("module", moduleSource, module, options, dependencyTemplates);
|
||||
const moduleSourcePostContent = this.applyPluginsWaterfall("content", moduleSource, module, options, dependencyTemplates);
|
||||
const moduleSourcePostModule = this.applyPluginsWaterfall("module", moduleSourcePostContent, module, options, dependencyTemplates);
|
||||
const moduleSourcePostRender = this.applyPluginsWaterfall("render", moduleSourcePostModule, module, options, dependencyTemplates);
|
||||
return this.applyPluginsWaterfall("package", moduleSourcePostRender, module, options, dependencyTemplates);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ class NodeStuffPlugin {
|
|||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
|
||||
if(parserOptions.node === false)
|
||||
return;
|
||||
|
|
|
@ -363,7 +363,7 @@ class NormalModule extends Module {
|
|||
|
||||
contextArgument(block) {
|
||||
if(this === block) {
|
||||
return this.exportsArgument || "exports";
|
||||
return this.exportsArgument;
|
||||
}
|
||||
return "this";
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ class NormalModuleFactory extends Tapable {
|
|||
if(err) return callback(err);
|
||||
loaders = results[0].concat(loaders, results[1], results[2]);
|
||||
process.nextTick(() => {
|
||||
const type = settings.type || "javascript/auto";
|
||||
const type = settings.type || this.getDefaultType(resourcePath);
|
||||
callback(null, {
|
||||
context: context,
|
||||
request: loaders.map(loaderToIdent).concat([resource]).join("!"),
|
||||
|
@ -210,6 +210,16 @@ class NormalModuleFactory extends Tapable {
|
|||
});
|
||||
}
|
||||
|
||||
getDefaultType(resourcePath) {
|
||||
if(/\.wasm$/.test(resourcePath))
|
||||
return "webassembly/experimental";
|
||||
if(/\.mjs$/.test(resourcePath))
|
||||
return "javascript/esm";
|
||||
if(/\.json$/.test(resourcePath))
|
||||
return "json";
|
||||
return "javascript/auto";
|
||||
}
|
||||
|
||||
create(data, callback) {
|
||||
const dependencies = data.dependencies;
|
||||
const cacheEntry = dependencies[0].__NormalModuleFactoryCache;
|
||||
|
|
|
@ -19,7 +19,7 @@ class ProvidePlugin {
|
|||
compiler.plugin("compilation", (compilation, params) => {
|
||||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], (parser, parserOptions) => {
|
||||
Object.keys(definitions).forEach(name => {
|
||||
var request = [].concat(definitions[name]);
|
||||
var splittedName = name.split(".");
|
||||
|
|
|
@ -14,7 +14,7 @@ module.exports = class RequireJsStuffPlugin {
|
|||
compiler.plugin("compilation", (compilation, params) => {
|
||||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.requireJs !== "undefined" && !parserOptions.requireJs)
|
||||
return;
|
||||
|
|
|
@ -138,7 +138,9 @@ module.exports = class Template extends Tapable {
|
|||
var allModules = modules.map(module => {
|
||||
return {
|
||||
id: module.id,
|
||||
source: moduleTemplate.render(module, dependencyTemplates, { chunk })
|
||||
source: moduleTemplate.render(module, dependencyTemplates, {
|
||||
chunk
|
||||
})
|
||||
};
|
||||
});
|
||||
if(removedModules && removedModules.length > 0) {
|
||||
|
|
|
@ -9,7 +9,7 @@ const ConstDependency = require("./dependencies/ConstDependency");
|
|||
class UseStrictPlugin {
|
||||
apply(compiler) {
|
||||
compiler.plugin("compilation", (compilation, params) => {
|
||||
params.normalModuleFactory.plugin("parser", (parser) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], (parser) => {
|
||||
const parserInstance = parser;
|
||||
parser.plugin("program", (ast) => {
|
||||
const firstNode = ast.body[0];
|
||||
|
|
|
@ -8,7 +8,9 @@ const WebAssemblyParser = require("./WebAssemblyParser");
|
|||
|
||||
class WebAssemblyModulesPlugin {
|
||||
apply(compiler) {
|
||||
compiler.plugin("compilation", (compilation, { normalModuleFactory }) => {
|
||||
compiler.plugin("compilation", (compilation, {
|
||||
normalModuleFactory
|
||||
}) => {
|
||||
normalModuleFactory.plugin("create-parser webassembly/experimental", () => {
|
||||
return new WebAssemblyParser();
|
||||
});
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
const OptionsApply = require("./OptionsApply");
|
||||
|
||||
const JavascriptModulesPlugin = require("./JavascriptModulesPlugin");
|
||||
const JsonModulesPlugin = require("./JsonModulesPlugin");
|
||||
const WebAssemblyModulesPlugin = require("./WebAssemblyModulesPlugin");
|
||||
|
||||
const LoaderTargetPlugin = require("./LoaderTargetPlugin");
|
||||
|
@ -66,14 +67,15 @@ class WebpackOptionsApply extends OptionsApply {
|
|||
if(typeof options.target === "string") {
|
||||
let JsonpTemplatePlugin;
|
||||
let FetchCompileWasmTemplatePlugin;
|
||||
let ReadFileCompileWasmTemplatePlugin;
|
||||
let NodeSourcePlugin;
|
||||
let NodeTargetPlugin;
|
||||
let NodeTemplatePlugin;
|
||||
|
||||
switch(options.target) {
|
||||
case "web":
|
||||
JsonpTemplatePlugin = require("./JsonpTemplatePlugin");
|
||||
FetchCompileWasmTemplatePlugin = require("./FetchCompileWasmTemplatePlugin");
|
||||
JsonpTemplatePlugin = require("./web/JsonpTemplatePlugin");
|
||||
FetchCompileWasmTemplatePlugin = require("./web/FetchCompileWasmTemplatePlugin");
|
||||
NodeSourcePlugin = require("./node/NodeSourcePlugin");
|
||||
compiler.apply(
|
||||
new JsonpTemplatePlugin(options.output),
|
||||
|
@ -86,9 +88,11 @@ class WebpackOptionsApply extends OptionsApply {
|
|||
case "webworker":
|
||||
{
|
||||
let WebWorkerTemplatePlugin = require("./webworker/WebWorkerTemplatePlugin");
|
||||
FetchCompileWasmTemplatePlugin = require("./web/FetchCompileWasmTemplatePlugin");
|
||||
NodeSourcePlugin = require("./node/NodeSourcePlugin");
|
||||
compiler.apply(
|
||||
new WebWorkerTemplatePlugin(),
|
||||
new FetchCompileWasmTemplatePlugin(options.output),
|
||||
new FunctionModulePlugin(options.output),
|
||||
new NodeSourcePlugin(options.node),
|
||||
new LoaderTargetPlugin(options.target)
|
||||
|
@ -98,18 +102,20 @@ class WebpackOptionsApply extends OptionsApply {
|
|||
case "node":
|
||||
case "async-node":
|
||||
NodeTemplatePlugin = require("./node/NodeTemplatePlugin");
|
||||
ReadFileCompileWasmTemplatePlugin = require("./node/ReadFileCompileWasmTemplatePlugin");
|
||||
NodeTargetPlugin = require("./node/NodeTargetPlugin");
|
||||
compiler.apply(
|
||||
new NodeTemplatePlugin({
|
||||
asyncChunkLoading: options.target === "async-node"
|
||||
}),
|
||||
new ReadFileCompileWasmTemplatePlugin(options.output),
|
||||
new FunctionModulePlugin(options.output),
|
||||
new NodeTargetPlugin(),
|
||||
new LoaderTargetPlugin("node")
|
||||
);
|
||||
break;
|
||||
case "node-webkit":
|
||||
JsonpTemplatePlugin = require("./JsonpTemplatePlugin");
|
||||
JsonpTemplatePlugin = require("./web/JsonpTemplatePlugin");
|
||||
NodeTargetPlugin = require("./node/NodeTargetPlugin");
|
||||
ExternalsPlugin = require("./ExternalsPlugin");
|
||||
compiler.apply(
|
||||
|
@ -160,7 +166,7 @@ class WebpackOptionsApply extends OptionsApply {
|
|||
);
|
||||
break;
|
||||
case "electron-renderer":
|
||||
JsonpTemplatePlugin = require("./JsonpTemplatePlugin");
|
||||
JsonpTemplatePlugin = require("./web/JsonpTemplatePlugin");
|
||||
NodeTargetPlugin = require("./node/NodeTargetPlugin");
|
||||
ExternalsPlugin = require("./ExternalsPlugin");
|
||||
compiler.apply(
|
||||
|
@ -239,6 +245,7 @@ class WebpackOptionsApply extends OptionsApply {
|
|||
}
|
||||
compiler.apply(
|
||||
new JavascriptModulesPlugin(),
|
||||
new JsonModulesPlugin(),
|
||||
new WebAssemblyModulesPlugin()
|
||||
);
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
|
|||
this.set("resolve", "call", value => Object.assign({}, value));
|
||||
this.set("resolve.unsafeCache", true);
|
||||
this.set("resolve.modules", ["node_modules"]);
|
||||
this.set("resolve.extensions", [".js", ".json"]);
|
||||
this.set("resolve.extensions", [".mjs", ".js", ".json"]);
|
||||
this.set("resolve.mainFiles", ["index"]);
|
||||
this.set("resolve.aliasFields", "make", (options) => {
|
||||
if(options.target === "web" || options.target === "webworker")
|
||||
|
|
|
@ -56,7 +56,7 @@ class AMDPlugin {
|
|||
compilation.dependencyFactories.set(LocalModuleDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(LocalModuleDependency, new LocalModuleDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.amd !== "undefined" && !parserOptions.amd)
|
||||
return;
|
||||
|
|
|
@ -150,9 +150,9 @@ class AMDRequireDependenciesBlockParserPlugin {
|
|||
if(param.string === "require") {
|
||||
dep = new ConstDependency("__webpack_require__", param.string);
|
||||
} else if(param.string === "module") {
|
||||
dep = new ConstDependency(parser.state.module.moduleArgument || "module", param.range);
|
||||
dep = new ConstDependency(parser.state.module.moduleArgument, param.range);
|
||||
} else if(param.string === "exports") {
|
||||
dep = new ConstDependency(parser.state.module.exportsArgument || "exports", param.range);
|
||||
dep = new ConstDependency(parser.state.module.exportsArgument, param.range);
|
||||
} else if(localModule = LocalModulesHelpers.getLocalModule(parser.state, param.string)) { // eslint-disable-line no-cond-assign
|
||||
dep = new LocalModuleDependency(localModule, param.range);
|
||||
} else {
|
||||
|
|
|
@ -47,7 +47,7 @@ class CommonJsPlugin {
|
|||
compilation.dependencyFactories.set(RequireHeaderDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(RequireHeaderDependency, new RequireHeaderDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.commonjs !== "undefined" && !parserOptions.commonjs)
|
||||
return;
|
||||
|
|
|
@ -20,7 +20,7 @@ HarmonyCompatibilityDependency.Template = class HarmonyExportDependencyTemplate
|
|||
apply(dep, source) {
|
||||
const usedExports = dep.originModule.usedExports;
|
||||
if(usedExports && !Array.isArray(usedExports)) {
|
||||
const exportName = dep.originModule.exportsArgument || "exports";
|
||||
const exportName = dep.originModule.exportsArgument;
|
||||
const content = `Object.defineProperty(${exportName}, "__esModule", { value: true });\n`;
|
||||
source.insert(-10, content);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ const HarmonyInitDependency = require("./HarmonyInitDependency");
|
|||
module.exports = class HarmonyDetectionParserPlugin {
|
||||
apply(parser) {
|
||||
parser.plugin("program", (ast) => {
|
||||
var isHarmony = ast.body.some(statement => {
|
||||
const isStrictHarmony = parser.state.module.type === "javascript/esm";
|
||||
const isHarmony = isStrictHarmony || ast.body.some(statement => {
|
||||
return /^(Import|Export).*Declaration$/.test(statement.type);
|
||||
});
|
||||
if(isHarmony) {
|
||||
|
@ -45,6 +46,8 @@ module.exports = class HarmonyDetectionParserPlugin {
|
|||
module.meta.harmonyModule = true;
|
||||
module.strict = true;
|
||||
module.exportsArgument = "__webpack_exports__";
|
||||
if(isStrictHarmony)
|
||||
module.moduleArgument = "__webpack_module__";
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ HarmonyExportExpressionDependency.Template = class HarmonyExportDependencyTempla
|
|||
}
|
||||
|
||||
getContent(module, used) {
|
||||
const exportsName = module.exportsArgument || "exports";
|
||||
const exportsName = module.exportsArgument;
|
||||
if(used) {
|
||||
return `/* harmony default export */ ${exportsName}[${JSON.stringify(used)}] = `;
|
||||
}
|
||||
|
|
|
@ -344,7 +344,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
|
|||
content += "if(" + JSON.stringify(activeExports.concat("default")) + ".indexOf(__WEBPACK_IMPORT_KEY__) < 0) ";
|
||||
else
|
||||
content += "if(__WEBPACK_IMPORT_KEY__ !== 'default') ";
|
||||
const exportsName = dep.originModule.exportsArgument || "exports";
|
||||
const exportsName = dep.originModule.exportsArgument;
|
||||
return content + `(function(key) { __webpack_require__.d(${exportsName}, key, function() { return ${name}[key]; }) }(__WEBPACK_IMPORT_KEY__));\n`;
|
||||
}
|
||||
|
||||
|
@ -354,13 +354,13 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
|
|||
}
|
||||
|
||||
getReexportStatement(module, key, name, valueKey) {
|
||||
const exportsName = module.exportsArgument || "exports";
|
||||
const exportsName = module.exportsArgument;
|
||||
const returnValue = this.getReturnValue(valueKey);
|
||||
return `__webpack_require__.d(${exportsName}, ${JSON.stringify(key)}, function() { return ${name}${returnValue}; });\n`;
|
||||
}
|
||||
|
||||
getConditionalReexportStatement(module, key, name, valueKey) {
|
||||
const exportsName = module.exportsArgument || "exports";
|
||||
const exportsName = module.exportsArgument;
|
||||
const returnValue = this.getReturnValue(valueKey);
|
||||
return `if(__webpack_require__.o(${name}, ${JSON.stringify(valueKey)})) __webpack_require__.d(${exportsName}, ${JSON.stringify(key)}, function() { return ${name}${returnValue}; });\n`;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ HarmonyExportSpecifierDependency.Template = class HarmonyExportSpecifierDependen
|
|||
return `/* unused harmony export ${(dep.name || "namespace")} */\n`;
|
||||
}
|
||||
|
||||
const exportsName = dep.originModule.exportsArgument || "exports";
|
||||
const exportsName = dep.originModule.exportsArgument;
|
||||
|
||||
return `/* harmony export (binding) */ __webpack_require__.d(${exportsName}, ${JSON.stringify(used)}, function() { return ${dep.id}; });\n`;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ class HarmonyModulesPlugin {
|
|||
compilation.dependencyFactories.set(HarmonyAcceptImportDependency, normalModuleFactory);
|
||||
compilation.dependencyTemplates.set(HarmonyAcceptImportDependency, new HarmonyAcceptImportDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/esm"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.harmony !== "undefined" && !parserOptions.harmony)
|
||||
return;
|
||||
|
|
|
@ -33,7 +33,7 @@ class ImportPlugin {
|
|||
compilation.dependencyFactories.set(ImportContextDependency, contextModuleFactory);
|
||||
compilation.dependencyTemplates.set(ImportContextDependency, new ImportContextDependency.Template());
|
||||
|
||||
normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.import !== "undefined" && !parserOptions.import)
|
||||
return;
|
||||
|
|
|
@ -30,7 +30,7 @@ class RequireContextPlugin {
|
|||
|
||||
compilation.dependencyFactories.set(ContextElementDependency, normalModuleFactory);
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.requireContext !== "undefined" && !parserOptions.requireContext)
|
||||
return;
|
||||
|
|
|
@ -25,7 +25,7 @@ class RequireEnsurePlugin {
|
|||
compilation.dependencyFactories.set(RequireEnsureDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(RequireEnsureDependency, new RequireEnsureDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.requireEnsure !== "undefined" && !parserOptions.requireEnsure)
|
||||
return;
|
||||
|
|
|
@ -18,7 +18,7 @@ class RequireIncludePlugin {
|
|||
compilation.dependencyFactories.set(RequireIncludeDependency, normalModuleFactory);
|
||||
compilation.dependencyTemplates.set(RequireIncludeDependency, new RequireIncludeDependency.Template());
|
||||
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.requireInclude !== "undefined" && !parserOptions.requireInclude)
|
||||
return;
|
||||
|
|
|
@ -12,7 +12,7 @@ class SystemPlugin {
|
|||
|
||||
apply(compiler) {
|
||||
compiler.plugin("compilation", (compilation, params) => {
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic"], (parser, parserOptions) => {
|
||||
|
||||
if(typeof parserOptions.system !== "undefined" && !parserOptions.system)
|
||||
return;
|
||||
|
|
|
@ -44,7 +44,7 @@ module.exports = class NodeMainTemplatePlugin {
|
|||
}
|
||||
return source;
|
||||
});
|
||||
mainTemplate.plugin("require-ensure", (_, chunk, hash) => {
|
||||
mainTemplate.plugin("require-ensure", (source, chunk, hash) => {
|
||||
const chunkFilename = mainTemplate.outputOptions.chunkFilename;
|
||||
const chunkMaps = chunk.getChunkMaps();
|
||||
const insertMoreModules = [
|
||||
|
@ -55,20 +55,24 @@ module.exports = class NodeMainTemplatePlugin {
|
|||
];
|
||||
if(asyncChunkLoading) {
|
||||
return mainTemplate.asString([
|
||||
"// \"0\" is the signal for \"already loaded\"",
|
||||
"if(installedChunks[chunkId] === 0)",
|
||||
source,
|
||||
"",
|
||||
"// ReadFile + VM.run chunk loading for javascript",
|
||||
"",
|
||||
"var installedChunkData = installedChunks[chunkId];",
|
||||
"if(installedChunkData !== 0) { // 0 means \"already installed\".",
|
||||
mainTemplate.indent([
|
||||
"return Promise.resolve();"
|
||||
]),
|
||||
"// array of [resolve, reject, promise] means \"currently loading\"",
|
||||
"if(installedChunks[chunkId])",
|
||||
"if(installedChunkData) {",
|
||||
mainTemplate.indent([
|
||||
"return installedChunks[chunkId][2];"
|
||||
"promises.push(installedChunkData[2]);"
|
||||
]),
|
||||
"} else {",
|
||||
mainTemplate.indent([
|
||||
"// load the chunk and return promise to it",
|
||||
"var promise = new Promise(function(resolve, reject) {",
|
||||
mainTemplate.indent([
|
||||
"installedChunks[chunkId] = [resolve, reject];",
|
||||
"installedChunkData = installedChunks[chunkId] = [resolve, reject];",
|
||||
"var filename = __dirname + " + mainTemplate.applyPluginsWaterfall("asset-path", JSON.stringify(`/${chunkFilename}`), {
|
||||
hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`,
|
||||
hashWithLength: (length) => `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`,
|
||||
|
@ -109,7 +113,11 @@ module.exports = class NodeMainTemplatePlugin {
|
|||
"});"
|
||||
]),
|
||||
"});",
|
||||
"return installedChunks[chunkId][2] = promise;"
|
||||
"promises.push(installedChunkData[2] = promise);"
|
||||
]),
|
||||
"}"
|
||||
]),
|
||||
"}"
|
||||
]);
|
||||
} else {
|
||||
const request = mainTemplate.applyPluginsWaterfall("asset-path", JSON.stringify(`./${chunkFilename}`), {
|
||||
|
@ -130,6 +138,10 @@ module.exports = class NodeMainTemplatePlugin {
|
|||
}
|
||||
});
|
||||
return mainTemplate.asString([
|
||||
source,
|
||||
"",
|
||||
"// require() chunk loading for javascript",
|
||||
"",
|
||||
"// \"0\" is the signal for \"already loaded\"",
|
||||
"if(installedChunks[chunkId] !== 0) {",
|
||||
mainTemplate.indent([
|
||||
|
@ -139,7 +151,6 @@ module.exports = class NodeMainTemplatePlugin {
|
|||
mainTemplate.indent("installedChunks[chunkIds[i]] = 0;")
|
||||
])),
|
||||
"}",
|
||||
"return Promise.resolve();"
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -37,7 +37,7 @@ module.exports = class NodeSourcePlugin {
|
|||
};
|
||||
|
||||
compiler.plugin("compilation", (compilation, params) => {
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], (parser, parserOptions) => {
|
||||
|
||||
if(parserOptions.node === false)
|
||||
return;
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
class ReadFileCompileWasmMainTemplatePlugin {
|
||||
|
||||
apply(mainTemplate) {
|
||||
mainTemplate.plugin("local-vars", (source, chunk) => {
|
||||
return mainTemplate.asString([
|
||||
source,
|
||||
"",
|
||||
"// object to store loaded and loading wasm modules",
|
||||
"var installedWasmModules = {};",
|
||||
]);
|
||||
});
|
||||
mainTemplate.plugin("require-ensure", (source, chunk, hash) => {
|
||||
const webassemblyModuleFilename = mainTemplate.outputOptions.webassemblyModuleFilename;
|
||||
const chunkModuleMaps = chunk.getChunkModuleMaps(false, m => m.type.startsWith("webassembly"));
|
||||
if(Object.keys(chunkModuleMaps.id).length === 0) return source;
|
||||
const wasmModuleSrcPath = mainTemplate.applyPluginsWaterfall("asset-path", JSON.stringify(webassemblyModuleFilename), {
|
||||
hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`,
|
||||
hashWithLength: length => `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`,
|
||||
module: {
|
||||
id: "\" + wasmModuleId + \"",
|
||||
hash: `" + ${JSON.stringify(chunkModuleMaps.hash)}[wasmModuleId] + "`,
|
||||
hashWithLength(length) {
|
||||
const shortChunkHashMap = Object.create(null);
|
||||
Object.keys(chunkModuleMaps.hash).forEach(wasmModuleId => {
|
||||
if(typeof chunkModuleMaps.hash[wasmModuleId] === "string")
|
||||
shortChunkHashMap[wasmModuleId] = chunkModuleMaps.hash[wasmModuleId].substr(0, length);
|
||||
});
|
||||
return `" + ${JSON.stringify(shortChunkHashMap)}[wasmModuleId] + "`;
|
||||
}
|
||||
}
|
||||
});
|
||||
return mainTemplate.asString([
|
||||
source,
|
||||
"",
|
||||
"// ReadFile + compile chunk loading for webassembly",
|
||||
"",
|
||||
`var wasmModules = ${JSON.stringify(chunkModuleMaps.id)}[chunkId] || [];`,
|
||||
"",
|
||||
"wasmModules.forEach(function(wasmModuleId) {",
|
||||
mainTemplate.indent([
|
||||
"var installedWasmModuleData = installedWasmModules[wasmModuleId];",
|
||||
"",
|
||||
"// a Promise means \"currently loading\" or \"already loaded\".",
|
||||
"promises.push(installedWasmModuleData ||",
|
||||
mainTemplate.indent([
|
||||
"(installedWasmModules[wasmModuleId] = new Promise(function(resolve, reject) {",
|
||||
mainTemplate.indent([
|
||||
`require('fs').readFile(require('path').resolve(__dirname, ${wasmModuleSrcPath}), function(err, buffer) {`,
|
||||
mainTemplate.indent([
|
||||
"if(err) return reject(err);",
|
||||
"resolve(WebAssembly.compile(buffer));"
|
||||
]),
|
||||
"});"
|
||||
]),
|
||||
`}).then(function(module) { ${mainTemplate.requireFn}.w[wasmModuleId] = module; }))`
|
||||
]),
|
||||
");",
|
||||
]),
|
||||
"});",
|
||||
]);
|
||||
});
|
||||
mainTemplate.plugin("require-extensions", (source, chunk) => {
|
||||
return mainTemplate.asString([
|
||||
source,
|
||||
"",
|
||||
"// object with all compiled WebAssmbly.Modules",
|
||||
`${mainTemplate.requireFn}.w = {};`
|
||||
]);
|
||||
});
|
||||
mainTemplate.plugin("hash", hash => {
|
||||
hash.update("ReadFileCompileWasmMainTemplatePlugin");
|
||||
hash.update("1");
|
||||
hash.update(`${mainTemplate.outputOptions.webassemblyModuleFilename}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = ReadFileCompileWasmMainTemplatePlugin;
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const RawSource = require("webpack-sources").RawSource;
|
||||
|
||||
class ReadFileCompileWasmModuleTemplatePlugin {
|
||||
apply(moduleTemplate) {
|
||||
moduleTemplate.plugin("content", (moduleSource, module, {
|
||||
chunk
|
||||
}) => {
|
||||
if(module.type && module.type.startsWith("webassembly")) {
|
||||
if(chunk.isInitial())
|
||||
throw new Error("Sync WebAsssmbly compilation is not yet implemented");
|
||||
const source = new RawSource([
|
||||
"\"use strict\";",
|
||||
"",
|
||||
"// Instanciate WebAssembly module",
|
||||
"var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], {});",
|
||||
"",
|
||||
"// export exports from WebAssmbly module",
|
||||
// TODO rewrite this to getters depending on exports to support circular dependencies
|
||||
"module.exports = instance.exports;"
|
||||
].join("\n"));
|
||||
return source;
|
||||
} else {
|
||||
return moduleSource;
|
||||
}
|
||||
});
|
||||
|
||||
moduleTemplate.plugin("hash", hash => {
|
||||
hash.update("ReadFileCompileWasmModuleTemplatePlugin");
|
||||
hash.update("1");
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = ReadFileCompileWasmModuleTemplatePlugin;
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const ReadFileCompileWasmMainTemplatePlugin = require("./ReadFileCompileWasmMainTemplatePlugin");
|
||||
const ReadFileCompileWasmModuleTemplatePlugin = require("./ReadFileCompileWasmModuleTemplatePlugin");
|
||||
|
||||
class ReadFileCompileWasmTemplatePlugin {
|
||||
apply(compiler) {
|
||||
compiler.plugin("this-compilation", (compilation) => {
|
||||
compilation.mainTemplate.apply(new ReadFileCompileWasmMainTemplatePlugin());
|
||||
compilation.moduleTemplates.javascript.apply(new ReadFileCompileWasmModuleTemplatePlugin());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ReadFileCompileWasmTemplatePlugin;
|
|
@ -9,8 +9,8 @@ const Template = require("../Template");
|
|||
const Parser = require("../Parser");
|
||||
const acorn = require("acorn");
|
||||
const escope = require("escope");
|
||||
const ReplaceSource = require("webpack-sources/lib/ReplaceSource");
|
||||
const ConcatSource = require("webpack-sources/lib/ConcatSource");
|
||||
const ReplaceSource = require("webpack-sources").ReplaceSource;
|
||||
const ConcatSource = require("webpack-sources").ConcatSource;
|
||||
const HarmonyImportDependency = require("../dependencies/HarmonyImportDependency");
|
||||
const HarmonyImportSideEffectDependency = require("../dependencies/HarmonyImportSideEffectDependency");
|
||||
const HarmonyImportSpecifierDependency = require("../dependencies/HarmonyImportSpecifierDependency");
|
||||
|
@ -599,7 +599,7 @@ class ConcatenatedModule extends Module {
|
|||
// add harmony compatibility flag (must be first because of possible circular dependencies)
|
||||
const usedExports = this.rootModule.usedExports;
|
||||
if(usedExports === true) {
|
||||
result.add(`Object.defineProperty(${this.exportsArgument || "exports"}, "__esModule", { value: true });\n`);
|
||||
result.add(`Object.defineProperty(${this.exportsArgument}, "__esModule", { value: true });\n`);
|
||||
}
|
||||
|
||||
// define required namespace objects (must be before evaluation modules)
|
||||
|
@ -790,7 +790,7 @@ class HarmonyExportExpressionDependencyConcatenatedTemplate {
|
|||
let content = "/* harmony default export */ var __WEBPACK_MODULE_DEFAULT_EXPORT__ = ";
|
||||
if(dep.originModule === this.rootModule) {
|
||||
const used = dep.originModule.isUsed("default");
|
||||
const exportsName = dep.originModule.exportsArgument || "exports";
|
||||
const exportsName = dep.originModule.exportsArgument;
|
||||
if(used) content += `${exportsName}[${JSON.stringify(used)}] = `;
|
||||
}
|
||||
|
||||
|
@ -874,7 +874,7 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate {
|
|||
const exportData = new Buffer(def.id, "utf-8").toString("hex"); // eslint-disable-line node/no-deprecated-api
|
||||
finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}__`;
|
||||
}
|
||||
const exportsName = this.rootModule.exportsArgument || "exports";
|
||||
const exportsName = this.rootModule.exportsArgument;
|
||||
const content = `/* concated harmony reexport */__webpack_require__.d(${exportsName}, ${JSON.stringify(used)}, function() { return ${finalName}; });\n`;
|
||||
source.insert(-1, content);
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ class ModuleConcatenationPlugin {
|
|||
|
||||
apply(compiler) {
|
||||
compiler.plugin("compilation", (compilation, params) => {
|
||||
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
|
||||
params.normalModuleFactory.plugin(["parser javascript/auto", "parser javascript/dynamic", "parser javascript/esm"], (parser, parserOptions) => {
|
||||
parser.plugin("call eval", () => {
|
||||
parser.state.module.meta.hasEval = true;
|
||||
});
|
||||
|
|
|
@ -7,21 +7,21 @@
|
|||
class FetchCompileWasmMainTemplatePlugin {
|
||||
|
||||
apply(mainTemplate) {
|
||||
mainTemplate.plugin("local-vars", function(source, chunk) {
|
||||
return this.asString([
|
||||
mainTemplate.plugin("local-vars", (source, chunk) => {
|
||||
return mainTemplate.asString([
|
||||
source,
|
||||
"",
|
||||
"// object to store loaded and loading wasm modules",
|
||||
"var installedWasmModules = {};",
|
||||
]);
|
||||
});
|
||||
mainTemplate.plugin("require-ensure", function(source, chunk, hash) {
|
||||
const webassemblyModuleFilename = this.outputOptions.webassemblyModuleFilename;
|
||||
mainTemplate.plugin("require-ensure", (source, chunk, hash) => {
|
||||
const webassemblyModuleFilename = mainTemplate.outputOptions.webassemblyModuleFilename;
|
||||
const chunkModuleMaps = chunk.getChunkModuleMaps(false, m => m.type.startsWith("webassembly"));
|
||||
if(Object.keys(chunkModuleMaps.id).length === 0) return source;
|
||||
const wasmModuleSrcPath = this.applyPluginsWaterfall("asset-path", JSON.stringify(webassemblyModuleFilename), {
|
||||
hash: `" + ${this.renderCurrentHashCode(hash)} + "`,
|
||||
hashWithLength: length => `" + ${this.renderCurrentHashCode(hash, length)} + "`,
|
||||
const wasmModuleSrcPath = mainTemplate.applyPluginsWaterfall("asset-path", JSON.stringify(webassemblyModuleFilename), {
|
||||
hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`,
|
||||
hashWithLength: length => `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`,
|
||||
module: {
|
||||
id: "\" + wasmModuleId + \"",
|
||||
hash: `" + ${JSON.stringify(chunkModuleMaps.hash)}[wasmModuleId] + "`,
|
||||
|
@ -35,7 +35,7 @@ class FetchCompileWasmMainTemplatePlugin {
|
|||
}
|
||||
}
|
||||
});
|
||||
return this.asString([
|
||||
return mainTemplate.asString([
|
||||
source,
|
||||
"",
|
||||
"// Fetch + compile chunk loading for webassembly",
|
||||
|
@ -43,46 +43,43 @@ class FetchCompileWasmMainTemplatePlugin {
|
|||
`var wasmModules = ${JSON.stringify(chunkModuleMaps.id)}[chunkId] || [];`,
|
||||
"",
|
||||
"wasmModules.forEach(function(wasmModuleId) {",
|
||||
this.indent([
|
||||
mainTemplate.indent([
|
||||
"var installedWasmModuleData = installedWasmModules[wasmModuleId];",
|
||||
"",
|
||||
"// a Promise means \"currently loading\" or \"already loaded\".",
|
||||
"promises.push(installedWasmModuleData ||",
|
||||
this.indent([
|
||||
`promises.push(installedWasmModules[wasmModuleId] = fetch(${this.requireFn}.p + ${wasmModuleSrcPath}).then(function(response) {`,
|
||||
this.indent([
|
||||
mainTemplate.indent([
|
||||
`(installedWasmModules[wasmModuleId] = fetch(${mainTemplate.requireFn}.p + ${wasmModuleSrcPath}).then(function(response) {`,
|
||||
mainTemplate.indent([
|
||||
"if(WebAssembly.compileStreaming) {",
|
||||
this.indent([
|
||||
mainTemplate.indent([
|
||||
"return WebAssembly.compileStreaming(response);"
|
||||
]),
|
||||
"} else {",
|
||||
this.indent([
|
||||
mainTemplate.indent([
|
||||
"return response.arrayBuffer().then(function(bytes) { return WebAssembly.compile(bytes); });",
|
||||
]),
|
||||
"}"
|
||||
]),
|
||||
`}).then(function(module) { ${this.requireFn}.w[wasmModuleId] = module; }))`
|
||||
`}).then(function(module) { ${mainTemplate.requireFn}.w[wasmModuleId] = module; }))`
|
||||
]),
|
||||
");",
|
||||
]),
|
||||
"});",
|
||||
]);
|
||||
});
|
||||
mainTemplate.plugin("require-extensions", function(source, chunk) {
|
||||
return this.asString([
|
||||
mainTemplate.plugin("require-extensions", (source, chunk) => {
|
||||
return mainTemplate.asString([
|
||||
source,
|
||||
"",
|
||||
"// object with all compiled WebAssmbly.Modules",
|
||||
`${this.requireFn}.w = {};`
|
||||
`${mainTemplate.requireFn}.w = {};`
|
||||
]);
|
||||
});
|
||||
mainTemplate.plugin("hash", function(hash) {
|
||||
hash.update("jsonp");
|
||||
hash.update("5");
|
||||
hash.update(`${this.outputOptions.filename}`);
|
||||
hash.update(`${this.outputOptions.chunkFilename}`);
|
||||
hash.update(`${this.outputOptions.jsonpFunction}`);
|
||||
hash.update(`${this.outputOptions.hotUpdateFunction}`);
|
||||
mainTemplate.plugin("hash", hash => {
|
||||
hash.update("FetchCompileWasmMainTemplatePlugin");
|
||||
hash.update("1");
|
||||
hash.update(`${mainTemplate.outputOptions.webassemblyModuleFilename}`);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -8,7 +8,9 @@ const RawSource = require("webpack-sources").RawSource;
|
|||
|
||||
class FetchCompileWasmModuleTemplatePlugin {
|
||||
apply(moduleTemplate) {
|
||||
moduleTemplate.plugin("module", function(moduleSource, module, { chunk }) {
|
||||
moduleTemplate.plugin("content", (moduleSource, module, {
|
||||
chunk
|
||||
}) => {
|
||||
if(module.type && module.type.startsWith("webassembly")) {
|
||||
if(chunk.isInitial())
|
||||
throw new Error("Sync WebAsssmbly compilation is not yet implemented");
|
||||
|
@ -28,7 +30,7 @@ class FetchCompileWasmModuleTemplatePlugin {
|
|||
}
|
||||
});
|
||||
|
||||
moduleTemplate.plugin("hash", function(hash) {
|
||||
moduleTemplate.plugin("hash", hash => {
|
||||
hash.update("FetchCompileWasmModuleTemplatePlugin");
|
||||
hash.update("1");
|
||||
});
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
"use strict";
|
||||
|
||||
const Template = require("./Template");
|
||||
const Template = require("../Template");
|
||||
|
||||
class JsonpMainTemplatePlugin {
|
||||
|
||||
|
@ -115,14 +115,13 @@ class JsonpMainTemplatePlugin {
|
|||
mainTemplate.indent([
|
||||
"installedChunkData = installedChunks[chunkId] = [resolve, reject];"
|
||||
]),
|
||||
"installedChunkData[2] = promise;",
|
||||
"});",
|
||||
"promises.push(installedChunkData[2] = promise);",
|
||||
"",
|
||||
"// start chunk loading",
|
||||
"var head = document.getElementsByTagName('head')[0];",
|
||||
mainTemplate.applyPluginsWaterfall("jsonp-script", "", chunk, hash),
|
||||
"head.appendChild(script);",
|
||||
"promises.push(promise);"
|
||||
"head.appendChild(script);"
|
||||
]),
|
||||
"}",
|
||||
]),
|
|
@ -87,7 +87,6 @@ exportPlugins(exports, {
|
|||
"CachePlugin": () => require("./CachePlugin"),
|
||||
"ExtendedAPIPlugin": () => require("./ExtendedAPIPlugin"),
|
||||
"ExternalsPlugin": () => require("./ExternalsPlugin"),
|
||||
"JsonpTemplatePlugin": () => require("./JsonpTemplatePlugin"),
|
||||
"LibraryTemplatePlugin": () => require("./LibraryTemplatePlugin"),
|
||||
"LoaderTargetPlugin": () => require("./LoaderTargetPlugin"),
|
||||
"MemoryOutputFileSystem": () => require("./MemoryOutputFileSystem"),
|
||||
|
@ -119,3 +118,11 @@ exportPlugins(exports.optimize = {}, {
|
|||
"OccurrenceOrderPlugin": () => require("./optimize/OccurrenceOrderPlugin"),
|
||||
"UglifyJsPlugin": () => require("./optimize/UglifyJsPlugin")
|
||||
});
|
||||
exportPlugins(exports.web = {}, {
|
||||
"JsonpTemplatePlugin": () => require("./web/JsonpTemplatePlugin"),
|
||||
"FetchCompileWasmTemplatePlugin": () => require("./web/FetchCompileWasmTemplatePlugin"),
|
||||
});
|
||||
exportPlugins(exports.node = {}, {
|
||||
"NodeTemplatePlugin": () => require("./node/NodeTemplatePlugin"),
|
||||
"ReadFileCompileWasmTemplatePlugin": () => require("./node/ReadFileCompileWasmTemplatePlugin"),
|
||||
});
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
"enhanced-resolve": "^3.4.0",
|
||||
"escope": "^3.6.0",
|
||||
"interpret": "^1.0.0",
|
||||
"json-loader": "^0.5.4",
|
||||
"loader-runner": "^2.3.0",
|
||||
"loader-utils": "^1.1.0",
|
||||
"memory-fs": "~0.4.1",
|
||||
|
@ -47,6 +46,7 @@
|
|||
"jade": "^1.11.0",
|
||||
"jade-loader": "~0.8.0",
|
||||
"js-beautify": "^1.5.10",
|
||||
"json-loader": "^0.5.7",
|
||||
"less": "^2.5.1",
|
||||
"less-loader": "^4.0.3",
|
||||
"lodash": "^4.17.4",
|
||||
|
|
|
@ -663,6 +663,7 @@
|
|||
"javascript/auto",
|
||||
"javascript/dynamic",
|
||||
"javascript/esm",
|
||||
"json",
|
||||
"webassembly/experimental"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -247,7 +247,7 @@ module.exports = some/request;`;
|
|||
it("deletgates to #getSourceForGlobalVariableExternal", function() {
|
||||
["this", "window", "global"].forEach((type, i) => {
|
||||
// set up
|
||||
externalModule.type = type;
|
||||
externalModule.externalType = type;
|
||||
|
||||
// invoke
|
||||
externalModule.getSourceString();
|
||||
|
@ -264,7 +264,7 @@ module.exports = some/request;`;
|
|||
it("deletgates to #getSourceForCommonJsExternal", function() {
|
||||
["commonjs", "commonjs2"].forEach((type, i) => {
|
||||
// set up
|
||||
externalModule.type = type;
|
||||
externalModule.externalType = type;
|
||||
|
||||
// invoke
|
||||
externalModule.getSourceString();
|
||||
|
@ -281,7 +281,7 @@ module.exports = some/request;`;
|
|||
it("deletgates to #getSourceForAmdOrUmdExternal", function() {
|
||||
["amd", "umd", "umd2"].forEach((type, i) => {
|
||||
// set up
|
||||
externalModule.type = type;
|
||||
externalModule.externalType = type;
|
||||
|
||||
// invoke
|
||||
externalModule.getSourceString();
|
||||
|
@ -298,7 +298,7 @@ module.exports = some/request;`;
|
|||
it("deletgates to #getSourceForGlobalVariableExternal", function() {
|
||||
["foo", "bar", undefined].forEach((type, i) => {
|
||||
// set up
|
||||
externalModule.type = type;
|
||||
externalModule.externalType = type;
|
||||
|
||||
// invoke
|
||||
externalModule.getSourceString();
|
||||
|
|
|
@ -4,7 +4,7 @@ const should = require("should");
|
|||
const sinon = require("sinon");
|
||||
const TemplatePluginEnvironment = require("./helpers/TemplatePluginEnvironment");
|
||||
const ConcatSource = require("webpack-sources").ConcatSource;
|
||||
const JsonpExportMainTemplatePlugin = require("../lib/JsonpExportMainTemplatePlugin");
|
||||
const JsonpExportMainTemplatePlugin = require("../lib/web/JsonpExportMainTemplatePlugin");
|
||||
|
||||
describe("JsonpExportMainTemplatePlugin", () => {
|
||||
let env;
|
||||
|
|
|
@ -26,6 +26,7 @@ describe("NormalModule", function() {
|
|||
parse() {}
|
||||
};
|
||||
normalModule = new NormalModule(
|
||||
"javascript/auto",
|
||||
request,
|
||||
userRequest,
|
||||
rawRequest,
|
||||
|
@ -68,6 +69,7 @@ describe("NormalModule", function() {
|
|||
beforeEach(function() {
|
||||
userRequest = "some/userRequest!some/other/userRequest!some/thing/is/off/here";
|
||||
normalModule = new NormalModule(
|
||||
"javascript/auto",
|
||||
request,
|
||||
userRequest,
|
||||
rawRequest,
|
||||
|
@ -86,6 +88,7 @@ describe("NormalModule", function() {
|
|||
it("ignores paths in query parameters", function() {
|
||||
userRequest = "some/context/loader?query=foo\\bar&otherPath=testpath/other";
|
||||
normalModule = new NormalModule(
|
||||
"javascript/auto",
|
||||
request,
|
||||
userRequest,
|
||||
rawRequest,
|
||||
|
@ -109,6 +112,7 @@ describe("NormalModule", function() {
|
|||
beforeEach(function() {
|
||||
resource = baseResource + "?some=query";
|
||||
normalModule = new NormalModule(
|
||||
"javascript/auto",
|
||||
request,
|
||||
userRequest,
|
||||
rawRequest,
|
||||
|
|
|
@ -133,7 +133,7 @@ describe("TestCases", () => {
|
|||
modules: ["web_modules", "node_modules"],
|
||||
mainFields: ["webpack", "browser", "web", "browserify", ["jam", "main"], "main"],
|
||||
aliasFields: ["browser"],
|
||||
extensions: [".webpack.js", ".web.js", ".js", ".json"]
|
||||
extensions: [".mjs", ".webpack.js", ".web.js", ".js", ".json"]
|
||||
},
|
||||
resolveLoader: {
|
||||
modules: ["web_loaders", "web_modules", "node_loaders", "node_modules"],
|
||||
|
@ -181,12 +181,14 @@ describe("TestCases", () => {
|
|||
const p = path.join(outputDirectory, module);
|
||||
const fn = vm.runInThisContext("(function(require, module, exports, __dirname, it) {" + fs.readFileSync(p, "utf-8") + "\n})", p);
|
||||
const m = {
|
||||
exports: {}
|
||||
exports: {},
|
||||
webpackTestSuiteModule: true
|
||||
};
|
||||
fn.call(m.exports, _require, m, m.exports, outputDirectory, _it);
|
||||
return m.exports;
|
||||
} else return require(module);
|
||||
}
|
||||
_require.webpackTestSuiteRequire = true;
|
||||
_require("./bundle.js");
|
||||
if(exportedTest === 0) return done(new Error("No tests exported by test case"));
|
||||
done();
|
||||
|
|
|
@ -9,8 +9,8 @@ module.exports = function(content) {
|
|||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
callback(null, this.exec(source, url));
|
||||
}.bind(this));
|
||||
callback(null, JSON.parse(source));
|
||||
});
|
||||
}.bind(this),
|
||||
function(err, results) {
|
||||
if(err) {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
it("should not have commonjs stuff available", function() {
|
||||
if(typeof module !== "undefined") { // If module is available
|
||||
module.should.have.property("webpackTestSuiteModule"); // it must be the node.js module
|
||||
}
|
||||
if(typeof require !== "undefined") { // If require is available
|
||||
require.should.have.property("webpackTestSuiteRequire"); // it must be the node.js require
|
||||
}
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
it("should allow to run a WebAssembly module", function(done) {
|
||||
import("./module").then(function(module) {
|
||||
const result = module.run();
|
||||
result.should.be.eql(42);
|
||||
done();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
import { add, getNumber } from "./wasm.wasm";
|
||||
|
||||
export function run() {
|
||||
return add(getNumber(), 2);
|
||||
}
|
Binary file not shown.
|
@ -1,13 +1,13 @@
|
|||
Hash: 794ae6df9cb4748fbcd7794ae6df9cb4748fbcd7
|
||||
Hash: 0c4822f4b0f344d71ebc0c4822f4b0f344d71ebc
|
||||
Child fitting:
|
||||
Hash: 794ae6df9cb4748fbcd7
|
||||
Hash: 0c4822f4b0f344d71ebc
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
3b0abf784cffee9cdb84.js 2.29 kB 0 [emitted]
|
||||
fd43aeccca69e5179cb6.js 1.98 kB 4 [emitted]
|
||||
37a2e572a7162ac860f9.js 5.94 kB 5 [emitted]
|
||||
0fb4d7363ffcca01b706.js 5.94 kB 5 [emitted]
|
||||
e1f8db72211be4caf41d.js 1.03 kB 6 [emitted]
|
||||
Entrypoint main = 37a2e572a7162ac860f9.js e1f8db72211be4caf41d.js fd43aeccca69e5179cb6.js 3b0abf784cffee9cdb84.js
|
||||
Entrypoint main = 0fb4d7363ffcca01b706.js e1f8db72211be4caf41d.js fd43aeccca69e5179cb6.js 3b0abf784cffee9cdb84.js
|
||||
chunk {0} 3b0abf784cffee9cdb84.js 1.91 kB [initial] [rendered]
|
||||
> aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js
|
||||
[4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js 112 bytes {0} [built]
|
||||
|
@ -17,7 +17,7 @@ Child fitting:
|
|||
> aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js
|
||||
[0] (webpack)/test/statsCases/aggressive-splitting-entry/b.js 899 bytes {4} [built]
|
||||
[1] (webpack)/test/statsCases/aggressive-splitting-entry/c.js 899 bytes {4} [built]
|
||||
chunk {5} 37a2e572a7162ac860f9.js 1.8 kB [entry] [rendered] [recorded]
|
||||
chunk {5} 0fb4d7363ffcca01b706.js 1.8 kB [entry] [rendered] [recorded]
|
||||
> aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js
|
||||
[2] (webpack)/test/statsCases/aggressive-splitting-entry/d.js 899 bytes {5} [built]
|
||||
[5] (webpack)/test/statsCases/aggressive-splitting-entry/a.js 899 bytes {5} [built]
|
||||
|
@ -25,14 +25,14 @@ Child fitting:
|
|||
> aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js
|
||||
[3] (webpack)/test/statsCases/aggressive-splitting-entry/e.js 899 bytes {6} [built]
|
||||
Child content-change:
|
||||
Hash: 794ae6df9cb4748fbcd7
|
||||
Hash: 0c4822f4b0f344d71ebc
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
3b0abf784cffee9cdb84.js 2.29 kB 0 [emitted]
|
||||
fd43aeccca69e5179cb6.js 1.98 kB 4 [emitted]
|
||||
37a2e572a7162ac860f9.js 5.94 kB 5 [emitted]
|
||||
0fb4d7363ffcca01b706.js 5.94 kB 5 [emitted]
|
||||
e1f8db72211be4caf41d.js 1.03 kB 6 [emitted]
|
||||
Entrypoint main = 37a2e572a7162ac860f9.js e1f8db72211be4caf41d.js fd43aeccca69e5179cb6.js 3b0abf784cffee9cdb84.js
|
||||
Entrypoint main = 0fb4d7363ffcca01b706.js e1f8db72211be4caf41d.js fd43aeccca69e5179cb6.js 3b0abf784cffee9cdb84.js
|
||||
chunk {0} 3b0abf784cffee9cdb84.js 1.91 kB [initial] [rendered]
|
||||
> aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js
|
||||
[4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js 112 bytes {0} [built]
|
||||
|
@ -42,7 +42,7 @@ Child content-change:
|
|||
> aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js
|
||||
[0] (webpack)/test/statsCases/aggressive-splitting-entry/b.js 899 bytes {4} [built]
|
||||
[1] (webpack)/test/statsCases/aggressive-splitting-entry/c.js 899 bytes {4} [built]
|
||||
chunk {5} 37a2e572a7162ac860f9.js 1.8 kB [entry] [rendered] [recorded]
|
||||
chunk {5} 0fb4d7363ffcca01b706.js 1.8 kB [entry] [rendered] [recorded]
|
||||
> aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js
|
||||
[2] (webpack)/test/statsCases/aggressive-splitting-entry/d.js 899 bytes {5} [built]
|
||||
[5] (webpack)/test/statsCases/aggressive-splitting-entry/a.js 899 bytes {5} [built]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: b9000d018fcafbe7adf7
|
||||
Hash: 643982be9b8a84182a8b
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
1744d4ad4296f5fa250c.js 2.01 kB 0 [emitted]
|
||||
|
@ -8,8 +8,8 @@ fcea9401f4f21cf79d39.js 1.99 kB 1 [emitted]
|
|||
c1e3d74e221cc503e2e1.js 1.99 kB 4 [emitted]
|
||||
3d41758100f56aac517e.js 1.03 kB 5 [emitted]
|
||||
c64eeda8f0bfba682f9d.js 1.03 kB 6 [emitted]
|
||||
9410b3c3e392a3a95fec.js 8.52 kB 7 [emitted] main
|
||||
Entrypoint main = 9410b3c3e392a3a95fec.js
|
||||
520c994eaddf273485ec.js 8.5 kB 7 [emitted] main
|
||||
Entrypoint main = 520c994eaddf273485ec.js
|
||||
chunk {0} 1744d4ad4296f5fa250c.js 1.8 kB {7} [recorded]
|
||||
> aggressive-splitted duplicate [11] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 4:0-51
|
||||
> aggressive-splitted duplicate [11] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 5:0-44
|
||||
|
@ -44,6 +44,6 @@ chunk {5} 3d41758100f56aac517e.js 899 bytes {7}
|
|||
chunk {6} c64eeda8f0bfba682f9d.js 899 bytes {7}
|
||||
> [11] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 1:0-16
|
||||
[10] (webpack)/test/statsCases/aggressive-splitting-on-demand/a.js 899 bytes {6} [built]
|
||||
chunk {7} 9410b3c3e392a3a95fec.js (main) 248 bytes [entry]
|
||||
chunk {7} 520c994eaddf273485ec.js (main) 248 bytes [entry]
|
||||
> main [11] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js
|
||||
[11] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 248 bytes {7} [built]
|
|
@ -1,10 +1,10 @@
|
|||
Hash: acd61a6f698d13599727
|
||||
Hash: 5fa31bb3cd49eecb6ebd
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.bundle.js 288 bytes 0 [emitted]
|
||||
1.bundle.js 152 bytes 1 [emitted]
|
||||
2.bundle.js 232 bytes 2 [emitted]
|
||||
bundle.js 7.16 kB 3 [emitted] main
|
||||
bundle.js 7.14 kB 3 [emitted] main
|
||||
chunk {0} 0.bundle.js 54 bytes {3} [rendered]
|
||||
> [0] (webpack)/test/statsCases/chunks/index.js 3:0-16
|
||||
[3] (webpack)/test/statsCases/chunks/c.js 54 bytes {0} [built]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 46a7ae6dc4165f8abc60
|
||||
Hash: 9b62d877d26dd61e1fb9
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
main.js 2.69 kB 0 [emitted] main
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: <CLR=BOLD>46a7ae6dc4165f8abc60</CLR>
|
||||
Hash: <CLR=BOLD>9b62d877d26dd61e1fb9</CLR>
|
||||
Time: <CLR=BOLD>X</CLR>ms
|
||||
<CLR=BOLD>Asset</CLR> <CLR=BOLD>Size</CLR> <CLR=BOLD>Chunks</CLR> <CLR=39,BOLD><CLR=22> <CLR=39,BOLD><CLR=22><CLR=BOLD>Chunk Names</CLR>
|
||||
<CLR=32>main.js</CLR> 2.69 kB <CLR=BOLD>0</CLR> <CLR=32>[emitted]</CLR> main
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: <CLR=BOLD>46a7ae6dc4165f8abc60</CLR>
|
||||
Hash: <CLR=BOLD>9b62d877d26dd61e1fb9</CLR>
|
||||
Time: <CLR=BOLD>X</CLR>ms
|
||||
<CLR=BOLD>Asset</CLR> <CLR=BOLD>Size</CLR> <CLR=BOLD>Chunks</CLR> <CLR=39,BOLD><CLR=22> <CLR=39,BOLD><CLR=22><CLR=BOLD>Chunk Names</CLR>
|
||||
<CLR=32,BOLD>main.js</CLR> 2.69 kB <CLR=BOLD>0</CLR> <CLR=32,BOLD>[emitted]</CLR> main
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Hash: 555ed68441b4e61480de
|
||||
Hash: 6e3e301d55085d22e738
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
entry-1.js 81 bytes 0 [emitted] entry-1
|
||||
vendor-1.js 8.24 kB 1 [emitted] vendor-1
|
||||
vendor-1.js 8.21 kB 1 [emitted] vendor-1
|
||||
[0] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/a.js 22 bytes {1} [built]
|
||||
[1] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/b.js 22 bytes {1} [built]
|
||||
[2] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/c.js 22 bytes {1} [built]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 770feff5bea289bd08f4
|
||||
Hash: 6b34e4a15d90c981775e
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
entry-1.js 3.32 kB 0 [emitted] entry-1
|
||||
|
|
|
@ -6,7 +6,7 @@ Child normal:
|
|||
3.bundle.js 837 bytes 3 [emitted] x2
|
||||
4.bundle.js 530 bytes 4 [emitted] x1
|
||||
5.bundle.js 1.15 kB 5 [emitted] xx5
|
||||
bundle.js 7.24 kB 6 [emitted] main
|
||||
bundle.js 7.21 kB 6 [emitted] main
|
||||
chunk {0} 0.bundle.js (x4) 56 bytes {6} [rendered]
|
||||
> x4 [4] (webpack)/test/statsCases/commons-chunk-plugin-children/index.js 4:0-42
|
||||
[0] (webpack)/test/statsCases/commons-chunk-plugin-children/a.js 0 bytes {0} {1} {2} {3} {4} [built]
|
||||
|
@ -51,7 +51,7 @@ Child children:
|
|||
3.bundle.js 692 bytes 3 [emitted] x2
|
||||
4.bundle.js 472 bytes 4 [emitted] x1
|
||||
5.bundle.js 1.15 kB 5 [emitted] xx5
|
||||
bundle.js 7.36 kB 6 [emitted] main
|
||||
bundle.js 7.34 kB 6 [emitted] main
|
||||
chunk {0} 0.bundle.js (x4) 56 bytes {6} [rendered]
|
||||
> x4 [4] (webpack)/test/statsCases/commons-chunk-plugin-children/index.js 4:0-42
|
||||
[1] (webpack)/test/statsCases/commons-chunk-plugin-children/c.js 0 bytes {0} {1} {5} [built]
|
||||
|
@ -90,7 +90,7 @@ Child async:
|
|||
4.bundle.js 692 bytes 4 [emitted] x2
|
||||
5.bundle.js 472 bytes 5 [emitted] x1
|
||||
6.bundle.js 1.15 kB 6 [emitted] xx5
|
||||
bundle.js 7.44 kB 7 [emitted] main
|
||||
bundle.js 7.42 kB 7 [emitted] main
|
||||
chunk {0} 0.bundle.js 0 bytes {7} [rendered]
|
||||
> async commons x1 [4] (webpack)/test/statsCases/commons-chunk-plugin-children/index.js 1:0-42
|
||||
> async commons x2 [4] (webpack)/test/statsCases/commons-chunk-plugin-children/index.js 2:0-42
|
||||
|
@ -134,7 +134,7 @@ Child deep-children:
|
|||
3.bundle.js 912 bytes 3 [emitted] x3
|
||||
4.bundle.js 692 bytes 4 [emitted] x2
|
||||
5.bundle.js 472 bytes 5 [emitted] x1
|
||||
bundle.js 7.41 kB 6 [emitted] main
|
||||
bundle.js 7.39 kB 6 [emitted] main
|
||||
chunk {0} 0.bundle.js (xx5) 42 bytes {6} [rendered]
|
||||
> xx5 [9] (webpack)/test/statsCases/commons-chunk-plugin-children/x5.js 3:0-44
|
||||
[3] (webpack)/test/statsCases/commons-chunk-plugin-children/d.js 0 bytes {0} {1} [built]
|
||||
|
@ -171,7 +171,7 @@ Child deep-async:
|
|||
4.bundle.js 692 bytes 4 [emitted] x2
|
||||
5.bundle.js 472 bytes 5 [emitted] x1
|
||||
6.bundle.js 1.03 kB 6 [emitted] xx5
|
||||
bundle.js 7.44 kB 7 [emitted] main
|
||||
bundle.js 7.42 kB 7 [emitted] main
|
||||
chunk {0} 0.bundle.js 0 bytes {7} [rendered]
|
||||
> async commons x1 [4] (webpack)/test/statsCases/commons-chunk-plugin-children/index.js 1:0-42
|
||||
> async commons x2 [4] (webpack)/test/statsCases/commons-chunk-plugin-children/index.js 2:0-42
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
Hash: c107a06e25bb732bf473181ecf9358e3cc7f45e7
|
||||
Hash: 5d62edfa66d98709f5017b119fd7e38c61b8ef0d
|
||||
Child
|
||||
Hash: c107a06e25bb732bf473
|
||||
Hash: 5d62edfa66d98709f501
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
app.js 1.32 kB 0 [emitted] app
|
||||
vendor.3210cd7580ff3ec8d7c1.js 619 bytes 1 [emitted] vendor
|
||||
runtime.js 7.25 kB 2 [emitted] runtime
|
||||
runtime.js 7.22 kB 2 [emitted] runtime
|
||||
[./constants.js] (webpack)/test/statsCases/commons-plugin-issue-4980/constants.js 87 bytes {1} [built]
|
||||
[./entry-1.js] (webpack)/test/statsCases/commons-plugin-issue-4980/entry-1.js 67 bytes {0} [built]
|
||||
[./submodule-a.js] (webpack)/test/statsCases/commons-plugin-issue-4980/submodule-a.js 59 bytes {0} [built]
|
||||
[./submodule-b.js] (webpack)/test/statsCases/commons-plugin-issue-4980/submodule-b.js 59 bytes {0} [built]
|
||||
Child
|
||||
Hash: 181ecf9358e3cc7f45e7
|
||||
Hash: 7b119fd7e38c61b8ef0d
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
app.js 1.37 kB 0 [emitted] app
|
||||
vendor.3210cd7580ff3ec8d7c1.js 619 bytes 1 [emitted] vendor
|
||||
runtime.js 7.25 kB 2 [emitted] runtime
|
||||
runtime.js 7.22 kB 2 [emitted] runtime
|
||||
[./constants.js] (webpack)/test/statsCases/commons-plugin-issue-4980/constants.js 87 bytes {1} [built]
|
||||
[./entry-2.js] (webpack)/test/statsCases/commons-plugin-issue-4980/entry-2.js 67 bytes {0} [built]
|
||||
[./submodule-a.js] (webpack)/test/statsCases/commons-plugin-issue-4980/submodule-a.js 59 bytes {0} [built]
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
Hash: 5740106240ac3936376e1d8c50bebd858f67edaf
|
||||
Hash: 591f65b34ea2fed28590a2524f672c23ebaef569
|
||||
Child
|
||||
Hash: 5740106240ac3936376e
|
||||
Hash: 591f65b34ea2fed28590
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
main.js 2.73 kB 0 [emitted] main
|
||||
[0] (webpack)/test/statsCases/define-plugin/index.js 24 bytes {0} [built]
|
||||
Child
|
||||
Hash: 1d8c50bebd858f67edaf
|
||||
Hash: a2524f672c23ebaef569
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
main.js 2.73 kB 0 [emitted] main
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Hash: 42d4b473056b7c1c9f38
|
||||
Hash: e2851c8d4cdd7e82ca78
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 3.14 kB 0 [emitted] main
|
||||
bundle.js 3.13 kB 0 [emitted] main
|
||||
+ 1 hidden asset
|
||||
[0] (webpack)/test/statsCases/exclude-with-loader/index.js 77 bytes {0} [built]
|
||||
[1] (webpack)/test/statsCases/exclude-with-loader/a.txt 43 bytes {0} [built]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 6d4c276e12a806fa09b1
|
||||
Hash: 7aea3de5f4fd504d5195
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
main.js 2.82 kB 0 [emitted] main
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
Hash: 19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0cd4abefb3963c61372a0
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
|
||||
WARNING in bundle.js from UglifyJs
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap 19b74c5b0289d95eca2a:5,0]
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap cd4abefb3963c61372a0:5,0]
|
||||
Dropping side-effect-free statement [./index.js:6,0]
|
||||
Dropping unused function someUnUsedFunction1 [./index.js:8,0]
|
||||
Dropping unused function someUnUsedFunction2 [./index.js:9,0]
|
||||
|
@ -19,43 +19,43 @@ Child
|
|||
Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0]
|
||||
Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
|
||||
WARNING in bundle.js from UglifyJs
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap 19b74c5b0289d95eca2a:5,0]
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap cd4abefb3963c61372a0:5,0]
|
||||
Dropping side-effect-free statement [./index.js:6,0]
|
||||
Dropping unused function someUnUsedFunction1 [./index.js:8,0]
|
||||
Dropping unused function someUnUsedFunction2 [./index.js:9,0]
|
||||
|
@ -68,13 +68,13 @@ Child
|
|||
Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0]
|
||||
Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
|
||||
WARNING in bundle.js from UglifyJs
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap 19b74c5b0289d95eca2a:5,0]
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap cd4abefb3963c61372a0:5,0]
|
||||
Dropping side-effect-free statement [./index.js:6,0]
|
||||
Dropping unused function someUnUsedFunction1 [./index.js:8,0]
|
||||
Dropping unused function someUnUsedFunction2 [./index.js:9,0]
|
||||
|
@ -87,13 +87,13 @@ Child
|
|||
Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0]
|
||||
Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
|
||||
WARNING in bundle.js from UglifyJs
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap 19b74c5b0289d95eca2a:5,0]
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap cd4abefb3963c61372a0:5,0]
|
||||
Dropping side-effect-free statement [./index.js:6,0]
|
||||
Dropping unused function someUnUsedFunction1 [./index.js:8,0]
|
||||
Dropping unused function someUnUsedFunction2 [./index.js:9,0]
|
||||
|
@ -106,13 +106,13 @@ Child
|
|||
Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0]
|
||||
Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
|
||||
WARNING in bundle.js from UglifyJs
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap 19b74c5b0289d95eca2a:5,0]
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap cd4abefb3963c61372a0:5,0]
|
||||
Dropping side-effect-free statement [./index.js:6,0]
|
||||
Dropping unused function someUnUsedFunction1 [./index.js:8,0]
|
||||
Dropping unused function someUnUsedFunction2 [./index.js:9,0]
|
||||
|
@ -125,13 +125,13 @@ Child
|
|||
Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0]
|
||||
Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
|
||||
WARNING in bundle.js from UglifyJs
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap 19b74c5b0289d95eca2a:5,0]
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap cd4abefb3963c61372a0:5,0]
|
||||
Dropping side-effect-free statement [./index.js:6,0]
|
||||
Dropping unused function someUnUsedFunction1 [./index.js:8,0]
|
||||
Dropping unused function someUnUsedFunction2 [./index.js:9,0]
|
||||
|
@ -144,13 +144,13 @@ Child
|
|||
Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0]
|
||||
Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
|
||||
Child
|
||||
Hash: 19b74c5b0289d95eca2a
|
||||
Hash: cd4abefb3963c61372a0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
|
||||
WARNING in bundle.js from UglifyJs
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap 19b74c5b0289d95eca2a:5,0]
|
||||
Dropping unused variable installedWasmModules [webpack/bootstrap cd4abefb3963c61372a0:5,0]
|
||||
Dropping side-effect-free statement [./index.js:6,0]
|
||||
Dropping unused function someUnUsedFunction1 [./index.js:8,0]
|
||||
Dropping unused function someUnUsedFunction2 [./index.js:9,0]
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Hash: 6c4d6f1ed0a9a90ec93e
|
||||
Hash: 9a8c88d293855a916088
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.js 339 bytes 0 [emitted]
|
||||
1.js 345 bytes 1 [emitted]
|
||||
2.js 336 bytes 2 [emitted]
|
||||
entry.js 7.88 kB 3 [emitted] entry
|
||||
entry.js 7.86 kB 3 [emitted] entry
|
||||
[0] (webpack)/test/statsCases/import-context-filter/templates/bar.js 38 bytes {2} [optional] [built]
|
||||
[1] (webpack)/test/statsCases/import-context-filter/templates/baz.js 38 bytes {1} [optional] [built]
|
||||
[2] (webpack)/test/statsCases/import-context-filter/templates/foo.js 38 bytes {0} [optional] [built]
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Hash: a6cd1e3ec94a80959c78
|
||||
Hash: 9915cc41cf8ad107ab1e
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.js 149 bytes 0 [emitted]
|
||||
entry.js 7.28 kB 1 [emitted] entry
|
||||
entry.js 7.26 kB 1 [emitted] entry
|
||||
[0] (webpack)/test/statsCases/import-weak/modules/b.js 22 bytes {0} [built]
|
||||
[1] (webpack)/test/statsCases/import-weak/entry.js 120 bytes {1} [built]
|
||||
[2] (webpack)/test/statsCases/import-weak/modules/a.js 37 bytes [built]
|
|
@ -1,6 +1,6 @@
|
|||
Hash: 468570e5397bec3aa1424f36dcb9c59adabdac76a4dfe141df617e196eba275cb1ecca589a656bdb
|
||||
Hash: 8a563b80ea8746a3892436a7c7bbedbe36681d4bad59fc60a72e40a54e4dcc419a84b806e80ea299
|
||||
Child
|
||||
Hash: 468570e5397bec3aa142
|
||||
Hash: 8a563b80ea8746a38924
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 3.61 kB 0 [emitted] main
|
||||
|
@ -12,11 +12,11 @@ Child
|
|||
[4] (webpack)/test/statsCases/limit-chunk-count-plugin/d.js 22 bytes {0} [built]
|
||||
[5] (webpack)/test/statsCases/limit-chunk-count-plugin/e.js 22 bytes {0} [built]
|
||||
Child
|
||||
Hash: 4f36dcb9c59adabdac76
|
||||
Hash: 36a7c7bbedbe36681d4b
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.bundle.js 651 bytes 0 [emitted]
|
||||
bundle.js 7.19 kB 1 [emitted] main
|
||||
bundle.js 7.17 kB 1 [emitted] main
|
||||
chunk {0} 0.bundle.js 118 bytes {1} [rendered]
|
||||
[1] (webpack)/test/statsCases/limit-chunk-count-plugin/a.js 22 bytes {0} [built]
|
||||
[2] (webpack)/test/statsCases/limit-chunk-count-plugin/b.js 22 bytes {0} [built]
|
||||
|
@ -26,12 +26,12 @@ Child
|
|||
chunk {1} bundle.js (main) 73 bytes [entry] [rendered]
|
||||
[0] (webpack)/test/statsCases/limit-chunk-count-plugin/index.js 73 bytes {1} [built]
|
||||
Child
|
||||
Hash: a4dfe141df617e196eba
|
||||
Hash: ad59fc60a72e40a54e4d
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.bundle.js 504 bytes 0 [emitted]
|
||||
1.bundle.js 232 bytes 1 [emitted]
|
||||
bundle.js 7.19 kB 2 [emitted] main
|
||||
bundle.js 7.17 kB 2 [emitted] main
|
||||
chunk {0} 0.bundle.js 74 bytes {2} [rendered]
|
||||
[1] (webpack)/test/statsCases/limit-chunk-count-plugin/a.js 22 bytes {0} [built]
|
||||
[3] (webpack)/test/statsCases/limit-chunk-count-plugin/c.js 30 bytes {0} [built]
|
||||
|
@ -42,13 +42,13 @@ Child
|
|||
chunk {2} bundle.js (main) 73 bytes [entry] [rendered]
|
||||
[0] (webpack)/test/statsCases/limit-chunk-count-plugin/index.js 73 bytes {2} [built]
|
||||
Child
|
||||
Hash: 275cb1ecca589a656bdb
|
||||
Hash: cc419a84b806e80ea299
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.bundle.js 232 bytes 0 [emitted]
|
||||
1.bundle.js 254 bytes 1 [emitted]
|
||||
2.bundle.js 333 bytes 2 [emitted]
|
||||
bundle.js 7.18 kB 3 [emitted] main
|
||||
bundle.js 7.16 kB 3 [emitted] main
|
||||
chunk {0} 0.bundle.js 44 bytes {2} {3} [rendered]
|
||||
[2] (webpack)/test/statsCases/limit-chunk-count-plugin/b.js 22 bytes {0} [built]
|
||||
[5] (webpack)/test/statsCases/limit-chunk-count-plugin/e.js 22 bytes {0} [built]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 25e5bbed2cc755384806
|
||||
Hash: ce34adc7e3ac058ea5f0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
main.js 6 kB 0 [emitted] main
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 25e5bbed2cc755384806
|
||||
Hash: ce34adc7e3ac058ea5f0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
main.js 6 kB 0 [emitted] main
|
||||
|
|
|
@ -2,9 +2,9 @@ Asset Size Chunks Chunk Names
|
|||
0.js 839 bytes 0 [emitted] async3
|
||||
1.js 839 bytes 1 [emitted] async2
|
||||
2.js 839 bytes 2 [emitted] async1
|
||||
e3.js 8.23 kB 3 [emitted] e3
|
||||
e2.js 8.21 kB 4 [emitted] e2
|
||||
e1.js 8.19 kB 5 [emitted] e1
|
||||
e3.js 8.21 kB 3 [emitted] e3
|
||||
e2.js 8.19 kB 4 [emitted] e2
|
||||
e1.js 8.17 kB 5 [emitted] e1
|
||||
chunk {0} 0.js (async3) 89 bytes {1} {3} [rendered]
|
||||
[4] (webpack)/test/statsCases/module-deduplication-named/h.js 9 bytes {0} {3} [built]
|
||||
[7] (webpack)/test/statsCases/module-deduplication-named/async3.js 80 bytes {0} [built]
|
||||
|
|
|
@ -5,9 +5,9 @@ Asset Size Chunks Chunk Names
|
|||
3.js 692 bytes 3 [emitted]
|
||||
4.js 692 bytes 4 [emitted]
|
||||
5.js 692 bytes 5 [emitted]
|
||||
e3.js 8.43 kB 6 [emitted] e3
|
||||
e2.js 8.4 kB 7 [emitted] e2
|
||||
e1.js 8.38 kB 8 [emitted] e1
|
||||
e3.js 8.4 kB 6 [emitted] e3
|
||||
e2.js 8.38 kB 7 [emitted] e2
|
||||
e1.js 8.36 kB 8 [emitted] e1
|
||||
chunk {0} 0.js 37 bytes {7} {8} [rendered]
|
||||
[6] (webpack)/test/statsCases/module-deduplication/async3.js 28 bytes {0} {3} [built]
|
||||
[7] (webpack)/test/statsCases/module-deduplication/h.js 9 bytes {0} {6} [built]
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
Hash: e569776cf2d7bb15f549
|
||||
Hash: 2bb1fb80e892d7ca83ed
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
chunk-containing-__a_js.js 316 bytes chunk-containing-__a_js [emitted]
|
||||
chunk-containing-__b_js.js 173 bytes chunk-containing-__b_js [emitted]
|
||||
entry.js 7.07 kB entry [emitted] entry
|
||||
entry.js 7.04 kB entry [emitted] entry
|
||||
[0] (webpack)/test/statsCases/named-chunks-plugin-async/modules/b.js 22 bytes {chunk-containing-__b_js} [built]
|
||||
[1] (webpack)/test/statsCases/named-chunks-plugin-async/entry.js 47 bytes {entry} [built]
|
||||
[2] (webpack)/test/statsCases/named-chunks-plugin-async/modules/a.js 37 bytes {chunk-containing-__a_js} [built]
|
|
@ -1,8 +1,8 @@
|
|||
Hash: a1229254603619424568
|
||||
Hash: 3e5729d50a2db92f6b0e
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
entry.js 615 bytes entry [emitted] entry
|
||||
manifest.js 7.26 kB manifest [emitted] manifest
|
||||
manifest.js 7.23 kB manifest [emitted] manifest
|
||||
vendor.js 469 bytes vendor [emitted] vendor
|
||||
[0] multi ./modules/a ./modules/b 40 bytes {vendor} [built]
|
||||
[./entry.js] (webpack)/test/statsCases/named-chunks-plugin/entry.js 72 bytes {entry} [built]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 7c00c9ec24322c092eb7
|
||||
Hash: f3ec4488d129c46ade54
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.js 281 bytes 0 [emitted] cir1
|
||||
|
@ -8,7 +8,7 @@ Time: Xms
|
|||
4.js 212 bytes 4, 6 [emitted] chunk
|
||||
5.js 356 bytes 5, 3 [emitted] cir2 from cir1
|
||||
6.js 130 bytes 6 [emitted] ac in ab
|
||||
main.js 7.85 kB 7 [emitted] main
|
||||
main.js 7.83 kB 7 [emitted] main
|
||||
chunk {0} 0.js (cir1) 81 bytes {3} {7} [rendered]
|
||||
> duplicate cir1 from cir2 [6] (webpack)/test/statsCases/optimize-chunks/circular2.js 1:0-79
|
||||
> duplicate cir1 [7] (webpack)/test/statsCases/optimize-chunks/index.js 13:0-54
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Hash: 7b6e615d7bd302eb9c50
|
||||
Hash: c40b21f5fbec6559b344
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.js 288 bytes 0 [emitted]
|
||||
1.js 152 bytes 1 [emitted]
|
||||
2.js 232 bytes 2 [emitted]
|
||||
main.js 7.16 kB 3 [emitted] main
|
||||
main.js 7.13 kB 3 [emitted] main
|
||||
Entrypoint main = main.js
|
||||
chunk {0} 0.js 54 bytes {3} [rendered]
|
||||
> [0] (webpack)/test/statsCases/preset-detailed/index.js 3:0-16
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Hash: 7b6e615d7bd302eb9c50
|
||||
Hash: c40b21f5fbec6559b344
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.js 288 bytes 0 [emitted]
|
||||
1.js 152 bytes 1 [emitted]
|
||||
2.js 232 bytes 2 [emitted]
|
||||
main.js 7.16 kB 3 [emitted] main
|
||||
main.js 7.13 kB 3 [emitted] main
|
||||
[0] (webpack)/test/statsCases/preset-normal/index.js 51 bytes {3} [built]
|
||||
[1] (webpack)/test/statsCases/preset-normal/a.js 22 bytes {3} [built]
|
||||
[2] (webpack)/test/statsCases/preset-normal/b.js 22 bytes {1} [built]
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Hash: 7b6e615d7bd302eb9c50
|
||||
Hash: c40b21f5fbec6559b344
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
0.js 288 bytes 0 [emitted]
|
||||
1.js 152 bytes 1 [emitted]
|
||||
2.js 232 bytes 2 [emitted]
|
||||
main.js 7.16 kB 3 [emitted] main
|
||||
main.js 7.13 kB 3 [emitted] main
|
||||
Entrypoint main = main.js
|
||||
chunk {0} 0.js 54 bytes {3} [rendered]
|
||||
> [0] (webpack)/test/statsCases/preset-verbose/index.js 3:0-16
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: b28ec09e6f09816bd407
|
||||
Hash: 2f10a36f9685efee695a
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 3.1 kB 0 [emitted] main
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 25e5bbed2cc755384806
|
||||
Hash: ce34adc7e3ac058ea5f0
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
main.js 6 kB 0 [emitted] main
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Hash: 8619511e846dc23eb000e02721a227f38dff757d
|
||||
Hash: 1392f84a24c55c490b5e2d28fa80892d711ae32b
|
||||
Child
|
||||
Hash: 8619511e846dc23eb000
|
||||
Hash: 1392f84a24c55c490b5e
|
||||
Time: Xms
|
||||
[0] (webpack)/test/statsCases/scope-hoisting-multi/common2.js 25 bytes {3} {4} [built]
|
||||
[1] (webpack)/test/statsCases/scope-hoisting-multi/common_lazy_shared.js 25 bytes {0} {1} {2} [built]
|
||||
|
@ -14,7 +14,7 @@ Child
|
|||
[9] (webpack)/test/statsCases/scope-hoisting-multi/second.js 177 bytes {4} [built]
|
||||
[10] (webpack)/test/statsCases/scope-hoisting-multi/lazy_second.js 55 bytes {1} [built]
|
||||
Child
|
||||
Hash: e02721a227f38dff757d
|
||||
Hash: 2d28fa80892d711ae32b
|
||||
Time: Xms
|
||||
[0] (webpack)/test/statsCases/scope-hoisting-multi/common_lazy_shared.js 25 bytes {0} {1} {2} [built]
|
||||
[1] (webpack)/test/statsCases/scope-hoisting-multi/vendor.js 25 bytes {5} [built]
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
Hash: 9b8205a049992bc9783bb1a58f5b0b09d9dd1037
|
||||
Hash: 83e56382e56968147d36dee705eb8be60b2037db
|
||||
Child
|
||||
Hash: 9b8205a049992bc9783b
|
||||
Hash: 83e56382e56968147d36
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
fd4c2ca1440010a55587.js 2.83 kB 0 [emitted] main
|
||||
240942974444681d3abd.js 2.83 kB 0 [emitted] main
|
||||
c815cf440254d4f3bba4e7041db00a28.css 26 bytes 0 [emitted] main
|
||||
[0] (webpack)/test/statsCases/separate-css-bundle/a/index.js 23 bytes {0} [built]
|
||||
[1] (webpack)/test/statsCases/separate-css-bundle/a/file.css 41 bytes {0} [built]
|
||||
|
@ -15,10 +15,10 @@ Child
|
|||
[0] (webpack)/node_modules/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 199 bytes {0} [built]
|
||||
[1] (webpack)/node_modules/css-loader/lib/css-base.js 2.26 kB {0} [built]
|
||||
Child
|
||||
Hash: b1a58f5b0b09d9dd1037
|
||||
Hash: dee705eb8be60b2037db
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
fd4c2ca1440010a55587.js 2.83 kB 0 [emitted] main
|
||||
240942974444681d3abd.js 2.83 kB 0 [emitted] main
|
||||
a3f385680aef7a9bb2a517699532cc34.css 28 bytes 0 [emitted] main
|
||||
[0] (webpack)/test/statsCases/separate-css-bundle/b/index.js 23 bytes {0} [built]
|
||||
[1] (webpack)/test/statsCases/separate-css-bundle/b/file.css 41 bytes {0} [built]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 2e10a5e30d58364c392c
|
||||
Hash: 9bd1f5491993467e8b27
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.69 kB 0 [emitted] main
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 2e10a5e30d58364c392c
|
||||
Hash: 9bd1f5491993467e8b27
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.69 kB 0 [emitted] main
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 86e656e04ad1845b5137
|
||||
Hash: 2500e9cab76400ff4f51
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 7.25 kB 0 [emitted] main
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Hash: 10e3e5dbac353b4cd892
|
||||
Hash: 7df1195d08327e14c776
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.13 kB 0 [emitted] main
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue