Merge branch 'v4-beta3' into jest

# Conflicts:
#	test/BenchmarkTestCases.benchmark.js
#	test/CachePlugin.unittest.js
#	test/HotTestCases.test.js
#	test/NormalModule.unittest.js
#	test/ProfilingPlugin.unittest.js
#	test/TestCases.test.js
#	test/configCases/parsing/harmony-this/index.js
#	test/configCases/plugins/profiling-plugin/index.js
#	test/configCases/plugins/profiling-plugin/webpack.config.js
#	test/watchCases/runtime/static-import/0/index.js
#	yarn.lock
This commit is contained in:
Bazyli Brzóska 2018-02-25 11:41:05 +01:00
commit 7b5c3516f6
281 changed files with 3083 additions and 1440 deletions

View File

@ -19,4 +19,4 @@
**If this is a feature request, what is motivation or use case for changing the behavior?**
**Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.**
**Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.**

View File

@ -13,7 +13,7 @@ If you are still having difficulty after looking over your configuration careful
a question to [StackOverflow with the webpack tag](http://stackoverflow.com/tags/webpack). Questions
that include your webpack.config.js and relevant files are more likely to receive responses.
**If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.**
**If you have discovered a bug or have a feature suggestion, please [create an issue on GitHub](https://github.com/webpack/webpack/issues/new).**
## Contributing to the webpack ecosystem
@ -60,4 +60,4 @@ documentation.
## Discussions
Gitters is only for small questions. To discuss in long a subject, please send on gitters a link to your forum or blog.
Gitter is only for small questions. To discuss a subject in detail, please send a link to your forum or blog in the Gitter chat.

View File

@ -52,7 +52,7 @@ yarn add webpack --dev
<h2 align="center">Introduction</h2>
> This README reflects Webpack v2.x and v3.x. The Webpack v1.x [documentation can be found here](https://webpack.github.io/docs/?utm_source=github&utm_medium=readme&utm_campaign=top).
> This README reflects Webpack v2.x and v3.x. The Webpack v1.x documentation has been deprecated and deleted.
webpack is a bundler for modules. The main purpose is to bundle JavaScript
files for usage in a browser, yet it is also capable of transforming, bundling,
@ -217,14 +217,14 @@ or are automatically applied via regex from your webpack configuration.
|Name|Status|Description|
|:--:|:----:|:----------|
|<a href="https://github.com/vuejs/vue-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/vue-9.svg"></a>|![vue-npm]|Loads and compiles Vue Components|
|<a href="https://github.com/JonDum/polymer-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/polymer.svg"></a>|![polymer-npm]|Process HTML & CSS with preprocessor of choice and `require()` Web Components like first-class modules|
|<a href="https://github.com/webpack-contrib/polymer-webpack-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/polymer.svg"></a>|![polymer-npm]|Process HTML & CSS with preprocessor of choice and `require()` Web Components like first-class modules|
|<a href="https://github.com/TheLarkInn/angular2-template-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/angular-icon-1.svg"></a>|![angular-npm]| Loads and compiles Angular 2 Components|
|<a href="https://github.com/riot/tag-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/riot.svg"></a>|![riot-npm]| Riot official webpack loader|
[vue-npm]: https://img.shields.io/npm/v/vue-loader.svg
[polymer-npm]: https://img.shields.io/npm/v/polymer-loader.svg
[polymer-npm]: https://img.shields.io/npm/v/polymer-webpack-loader.svg
[angular-npm]: https://img.shields.io/npm/v/angular2-template-loader.svg
[riot-npm]: https://img.shields.io/npm/v/riot-tag-loader.svg
@ -432,7 +432,7 @@ src="https://static.monei.net/monei-logo.svg" height="30" alt="MONEI"></a>
<h2 align="center">Silver Sponsors</h2>
[Become a sliver sponsor](https://opencollective.com/webpack#sponsor) and get your logo on our README on Github with a link to your site.
[Become a silver sponsor](https://opencollective.com/webpack#sponsor) and get your logo on our README on Github with a link to your site.
<div align="center">

View File

@ -15,7 +15,7 @@ const benchmarkOptions = {
function runTimes(compiler, times, deferred) {
fs.writeFileSync(path.join(fixtures, "0.js"), "module.exports = " + Math.random(), "utf-8");
compiler.run((err, stats) => {
compiler.run(err => {
if(err) throw err;
if(times === 1)
deferred.resolve();
@ -30,12 +30,12 @@ const tests = {
(size, deferred) => {
webpack({
context: fixtures,
entry: "./" + size + ".js",
entry: `./${size}.js`,
output: {
path: outputPath,
filename: "bundle.js"
}
}, (err, stats) => {
}, err => {
if(err) throw err;
deferred.resolve();
});
@ -46,16 +46,16 @@ const tests = {
(size, deferred) => {
webpack({
context: fixtures,
entry: "./" + size + ".big.js",
entry: `./${size}.big.js`,
output: {
path: outputPath,
filename: "bundle.js"
},
devtool: "eval"
}, (err, stats) => {
}, err => {
if(err) throw err;
deferred.resolve();
})
});
}
],
"sourcemap build": [
@ -63,16 +63,16 @@ const tests = {
(size, deferred) => {
webpack({
context: fixtures,
entry: "./" + size + ".big.js",
entry: `./${size}.big.js`,
output: {
path: outputPath,
filename: "bundle.js"
},
devtool: "source-map"
}, (err, stats) => {
}, err => {
if(err) throw err;
deferred.resolve();
})
});
}
],
"cheap sourcemap build": [
@ -80,16 +80,32 @@ const tests = {
(size, deferred) => {
webpack({
context: fixtures,
entry: "./" + size + ".big.js",
entry: `./${size}.big.js`,
output: {
path: outputPath,
filename: "bundle.js"
},
devtool: "cheap-source-map"
}, function(err, stats) {
}, err => {
if(err) throw err;
deferred.resolve();
})
});
}
],
"build w/ chunks": [
[0, 1, 5, 10, 50, 100, 200],
(size, deferred) => {
webpack({
context: fixtures,
entry: `./${size}.async.js`,
output: {
path: outputPath,
filename: "bundle.js"
}
}, err => {
if(err) throw err;
deferred.resolve();
});
}
],
"build w/ chunks": [
@ -102,26 +118,10 @@ const tests = {
path: outputPath,
filename: "bundle.js"
}
}, function(err, stats) {
}, err => {
if(err) throw err;
deferred.resolve();
})
}
],
"build w/ chunks": [
[0, 1, 5, 10, 50, 100, 200],
(size, deferred) => {
webpack({
context: fixtures,
entry: "./" + size + ".async.js",
output: {
path: outputPath,
filename: "bundle.js"
}
}, function(err, stats) {
if(err) throw err;
deferred.resolve();
})
});
}
],
"incremental": [
@ -161,7 +161,7 @@ const tests = {
var compiler = webpack({
cache: true,
context: fixtures,
entry: "./" + size + ".js",
entry: `./${size}.js`,
output: {
path: outputPath,
filename: "bundle.js"
@ -176,7 +176,7 @@ const tests = {
var compiler = webpack({
cache: true,
context: fixtures,
entry: "./" + size + ".js",
entry: `./${size}.js`,
output: {
path: outputPath,
filename: "bundle.js"
@ -191,7 +191,7 @@ const tests = {
var compiler = webpack({
cache: true,
context: fixtures,
entry: "./" + size + ".js",
entry: `./${size}.js`,
output: {
path: outputPath,
filename: "bundle.js"
@ -204,17 +204,17 @@ const tests = {
const suite = new Benchmark.Suite;
Object.keys(tests).filter((name) => (process.argv.length > 2) ? name.indexOf(process.argv[2]) >= 0 : true)
.forEach((name) => {
Object.keys(tests).filter(name => process.argv.length > 2 ? name.includes(process.argv[2]) : true)
.forEach(name => {
const test = tests[name];
test[0].forEach((size) => {
suite.add(name + " " + size, (deferred) => {
test[0].forEach(size => {
suite.add(`${name} ${size}`, deferred => {
test[1](size, deferred);
}, benchmarkOptions);
});
});
suite.on("cycle", (event) => {
suite.on("cycle", event => {
process.stderr.write("\n");
const b = event.target;
console.log(b.name + "\t" + Math.floor(1000 * (b.stats.mean - b.stats.moe)) + "\t" + Math.floor(1000 * (b.stats.mean + b.stats.moe)));

View File

@ -7,16 +7,21 @@ try {
fs.mkdirSync(fixtures);
} catch(e) {}
function generateRequireString(conditional, suffix) {
const prefixedSuffix = suffix ? `.${suffix}` : "";
return `require(${JSON.stringify(`./${conditional}${prefixedSuffix}.js`)});`;
}
for(let i = 0; i < 10000; i++) {
const source = [];
if(i > 8)
source.push("require(" + JSON.stringify("./" + (i / 8 | 0) + ".js") + ");");
source.push(generateRequireString((i / 8 | 0)));
if(i > 4)
source.push("require(" + JSON.stringify("./" + (i / 4 | 0) + ".js") + ");");
source.push(generateRequireString((i / 4 | 0)));
if(i > 2)
source.push("require(" + JSON.stringify("./" + (i / 2 | 0) + ".js") + ");");
source.push(generateRequireString((i / 2 | 0)));
if(i > 0)
source.push("require(" + JSON.stringify("./" + (i - 1) + ".js") + ");");
source.push(generateRequireString((i - 1)));
source.push("module.exports = " + i + ";");
fs.writeFileSync(path.join(fixtures, i + ".js"), source.join("\n"), "utf-8");
}
@ -25,13 +30,13 @@ for(let i = 0; i < 10000; i++) {
const source = [];
source.push("require.ensure([], function(require) {");
if(i > 8)
source.push("require(" + JSON.stringify("./" + (i / 8 | 0) + ".async.js") + ");");
source.push(generateRequireString((i / 8 | 0), "async"));
if(i > 4)
source.push("require(" + JSON.stringify("./" + (i / 4 | 0) + ".async.js") + ");");
source.push(generateRequireString((i / 4 | 0), "async"));
if(i > 2)
source.push("require(" + JSON.stringify("./" + (i / 2 | 0) + ".async.js") + ");");
source.push(generateRequireString((i / 2 | 0), "async"));
if(i > 0)
source.push("require(" + JSON.stringify("./" + (i - 1) + ".async.js") + ");");
source.push(generateRequireString((i - 1), "async"));
source.push("});");
source.push("module.exports = " + i + ";");
fs.writeFileSync(path.join(fixtures, i + ".async.js"), source.join("\n"), "utf-8");
@ -40,13 +45,13 @@ for(let i = 0; i < 10000; i++) {
for(let i = 0; i < 100; i++) {
const source = [];
if(i > 8)
source.push("require(" + JSON.stringify("./" + (i / 8 | 0) + ".big.js") + ");");
source.push(generateRequireString((i / 8 | 0), "big"));
if(i > 4)
source.push("require(" + JSON.stringify("./" + (i / 4 | 0) + ".big.js") + ");");
source.push(generateRequireString((i / 4 | 0), "big"));
if(i > 2)
source.push("require(" + JSON.stringify("./" + (i / 2 | 0) + ".big.js") + ");");
source.push(generateRequireString((i / 2 | 0), "big"));
if(i > 0)
source.push("require(" + JSON.stringify("./" + (i - 1) + ".big.js") + ");");
source.push(generateRequireString((i - 1), "big"));
for(let j = 0; j < 300; j++)
source.push("if(Math.random())hello.world();test.a.b.c.d();x(1,2,3,4);var a,b,c,d,e,f;");
source.push("module.exports = " + i + ";");

View File

@ -60,7 +60,7 @@ module.exports = {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.chunk.js 5.98 KiB 0 [emitted]
1.chunk.js 405 bytes 1 [emitted]
@ -108,7 +108,7 @@ chunk {4} pageA.bundle.js (pageA) 71 bytes >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.chunk.js 173 bytes 0, 1 [emitted]
1.chunk.js 118 bytes 1 [emitted]

View File

@ -8,7 +8,7 @@ const cp = require("child_process");
const path = require("path");
const tc = require("./template-common");
const fs = require("fs");
const async = require("async");
const async = require("neo-async");
const extraArgs = "";

View File

@ -10,19 +10,11 @@ The configuration required for this is:
# example.js
``` javascript
import vendor from "./vendor";
// some module
import("./async1");
import("./async2");
```
# vendor.js
``` javascript
// some vendor lib (should be in common chunk)
export default 123;
```
# webpack.config.js
``` javascript
@ -51,21 +43,18 @@ module.exports = {
</head>
<body>
<!-- inlined minimized file "manifest.[chunkhash].js" -->
<!-- inlined minimized file "runtime~main.[chunkhash].js" -->
<script>
!function(e){function r(r){for(var n,o,i=r[0],c=r[1],s=r[2],p=0,f=[];p<i.length;p++)o=i[p],u[o]&&f.push(u[o][0]),u[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);f.length;)f.shift()();return a.push.apply(a,s||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],o=!0,i=1;i<t.length;i++){var c=t[i];0!==u[c]&&(o=!1)}o&&(a.splice(r--,1),e=n(n.s=t[0]))}return e}function n(r){if(o[r])return o[r].exports;var t=o[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var o={},u={2:0},a=[];n.e=function(e){var r=[],t=u[e];if(0!==t)if(t)r.push(t[2]);else{var o=new Promise(function(r,n){t=u[e]=[r,n]});r.push(t[2]=o);var a=document.getElementsByTagName("head")[0],i=document.createElement("script");i.charset="utf-8",i.timeout=12e4,n.nc&&i.setAttribute("nonce",n.nc),i.src=n.p+""+({}[e]||e)+".[chunkhash].js";var c=setTimeout(function(){s({type:"timeout",target:i})},12e4);i.onerror=i.onload=s;function s(r){i.onerror=i.onload=null,clearTimeout(c);var t=u[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src,a=new Error("Loading chunk "+e+" failed.\n("+n+": "+o+")");a.type=n,a.request=o,t[1](a)}u[e]=void 0}}a.appendChild(i)}return Promise.all(r)},n.m=e,n.c=o,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="dist/",n.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var s=0;s<i.length;s++)r(i[s]);var l=c;t()}([]);
</script>
<!-- optional when using the CommonChunkPlugin for vendor modules -->
<script src="dist/main-runtime.[chunkhash].js"></script>
<script src="dist/main.[chunkhash].js"></script>
</body>
</html>
```
# dist/main-runtime.[chunkhash].js
# dist/runtime~main.[chunkhash].js
<details><summary><code>/******/ (function(modules) { /* webpackBootstrap */ })</code></summary>
@ -280,30 +269,12 @@ module.exports = {
/*!********************!*\
!*** ./example.js ***!
\********************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vendor */ 1);
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// some module
__webpack_require__.e(/*! import() */ 1).then(function() { var module = __webpack_require__(/*! ./async1 */ 2); return typeof module === "object" && module && module.__esModule ? module : { /* fake namespace object */ "default": module }; });
__webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpack_require__(/*! ./async2 */ 3); return typeof module === "object" && module && module.__esModule ? module : { /* fake namespace object */ "default": module }; });
/***/ }),
/* 1 */
/*!*******************!*\
!*** ./vendor.js ***!
\*******************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// some vendor lib (should be in common chunk)
/* harmony default export */ __webpack_exports__["default"] = (123);
__webpack_require__.e(/*! import() */ 1).then(function() { var module = __webpack_require__(/*! ./async1 */ 1); return typeof module === "object" && module && module.__esModule ? module : { /* fake namespace object */ "default": module }; });
__webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpack_require__(/*! ./async2 */ 2); return typeof module === "object" && module && module.__esModule ? module : { /* fake namespace object */ "default": module }; });
/***/ })
@ -316,30 +287,26 @@ __webpack_require__.r(__webpack_exports__);
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
main.[chunkhash].js 1.28 KiB 0 [emitted] main
1.[chunkhash].js 264 bytes 1 [emitted]
main.[chunkhash].js 768 bytes 0 [emitted] main
1.[chunkhash].js 270 bytes 1 [emitted]
2.[chunkhash].js 264 bytes 2 [emitted]
main-runtime.[chunkhash].js 7.49 KiB 3 [emitted] main-runtime
Entrypoint main = main-runtime.[chunkhash].js main.[chunkhash].js
chunk {0} main.[chunkhash].js (main) 159 bytes ={3}= >{1}< >{2}< [initial] [rendered]
runtime~main.[chunkhash].js 7.49 KiB 3 [emitted] runtime~main
Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js
chunk {0} main.[chunkhash].js (main) 58 bytes ={3}= >{1}< >{2}< [initial] [rendered]
> ./example main
[0] ./example.js 90 bytes {0} [built]
[no exports]
[0] ./example.js 58 bytes {0} [built]
single entry ./example main
[1] ./vendor.js 69 bytes {0} [built]
[exports: default]
harmony side effect evaluation ./vendor [0] ./example.js 1:0-30
chunk {1} 1.[chunkhash].js 29 bytes <{3}> <{0}> [rendered]
> ./async1 [0] ./example.js 3:0-18
[2] ./async1.js 29 bytes {1} [built]
import() ./async1 [0] ./example.js 3:0-18
chunk {2} 2.[chunkhash].js 29 bytes <{3}> <{0}> [rendered]
> ./async2 [0] ./example.js 4:0-18
[3] ./async2.js 29 bytes {2} [built]
import() ./async2 [0] ./example.js 4:0-18
chunk {3} main-runtime.[chunkhash].js (main-runtime) 0 bytes ={0}= >{1}< >{2}< [entry] [rendered]
chunk {1} 1.[chunkhash].js 29 bytes <{0}> <{3}> [rendered]
> ./async1 [0] ./example.js 2:0-18
[1] ./async1.js 29 bytes {1} [built]
import() ./async1 [0] ./example.js 2:0-18
chunk {2} 2.[chunkhash].js 29 bytes <{0}> <{3}> [rendered]
> ./async2 [0] ./example.js 3:0-18
[2] ./async2.js 29 bytes {2} [built]
import() ./async2 [0] ./example.js 3:0-18
chunk {3} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={0}= >{1}< >{2}< [entry] [rendered]
> ./example main
```
@ -347,33 +314,25 @@ chunk {3} main-runtime.[chunkhash].js (main-runtime) 0 bytes ={0}= >{1}< >{2}
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.[chunkhash].js 77 bytes 0 [emitted]
1.[chunkhash].js 78 bytes 1 [emitted]
main-runtime.[chunkhash].js 1.76 KiB 2 [emitted] main-runtime
main.[chunkhash].js 289 bytes 3 [emitted] main
Entrypoint main = main-runtime.[chunkhash].js main.[chunkhash].js
runtime~main.[chunkhash].js 1.76 KiB 2 [emitted] runtime~main
main.[chunkhash].js 269 bytes 3 [emitted] main
Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js
chunk {0} 0.[chunkhash].js 29 bytes <{2}> <{3}> [rendered]
> ./async2 [] 4:0-18
> ./async2 [0] ./example.js 3:0-18
[1] ./async2.js 29 bytes {0} [built]
import() ./async2 ./example.js 4:0-18
import() ./async2 [0] ./example.js 3:0-18
chunk {1} 1.[chunkhash].js 29 bytes <{2}> <{3}> [rendered]
> ./async1 [] 3:0-18
> ./async1 [0] ./example.js 2:0-18
[2] ./async1.js 29 bytes {1} [built]
import() ./async1 ./example.js 3:0-18
chunk {2} main-runtime.[chunkhash].js (main-runtime) 0 bytes ={3}= >{0}< >{1}< [entry] [rendered]
import() ./async1 [0] ./example.js 2:0-18
chunk {2} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={3}= >{0}< >{1}< [entry] [rendered]
> ./example main
chunk {3} main.[chunkhash].js (main) 159 bytes ={2}= >{0}< >{1}< [initial] [rendered]
chunk {3} main.[chunkhash].js (main) 58 bytes ={2}= >{0}< >{1}< [initial] [rendered]
> ./example main
[0] ./example.js + 1 modules 159 bytes {3} [built]
[no exports]
[0] ./example.js 58 bytes {3} [built]
single entry ./example main
| ./example.js 90 bytes [built]
| [no exports]
| single entry ./example main
| ./vendor.js 69 bytes [built]
| [exports: default]
| [no exports used]
| harmony side effect evaluation ./vendor ./example.js 1:0-30
```

View File

@ -1,4 +1,3 @@
import vendor from "./vendor";
// some module
import("./async1");
import("./async2");

View File

@ -13,12 +13,6 @@ The configuration required for this is:
{{example.js}}
```
# vendor.js
``` javascript
{{vendor.js}}
```
# webpack.config.js
``` javascript
@ -33,24 +27,21 @@ The configuration required for this is:
</head>
<body>
<!-- inlined minimized file "manifest.[chunkhash].js" -->
<!-- inlined minimized file "runtime~main.[chunkhash].js" -->
<script>
{{production:dist/main-runtime.chunkhash.js}}
{{production:dist/runtime~main.chunkhash.js}}
</script>
<!-- optional when using the CommonChunkPlugin for vendor modules -->
<script src="dist/main-runtime.[chunkhash].js"></script>
<script src="dist/main.[chunkhash].js"></script>
</body>
</html>
```
# dist/main-runtime.[chunkhash].js
# dist/runtime~main.[chunkhash].js
``` javascript
{{dist/main-runtime.chunkhash.js}}
{{dist/runtime~main.chunkhash.js}}
```
# dist/main.[chunkhash].js

View File

@ -1,2 +0,0 @@
// some vendor lib (should be in common chunk)
export default 123;

View File

@ -0,0 +1,140 @@
# example.js
``` javascript
require("./style.css");
require(["./chunk"]);
```
# style.css
``` css
body {
background: url(image.png);
}
```
# chunk.js
``` javascript
require("./style2.css");
```
# style2.css
``` css
.xyz {
background: url(image2.png);
}
```
# webpack.config.js
``` javascript
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
module: {
loaders: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
},
{ test: /\.png$/, loader: "file-loader" }
]
},
plugins: [
new ExtractTextPlugin({
filename: "style.css"
})
]
};
```
# js/style.css
``` javascript
body {
background: url(js/ce21cbdd9b894e6af794813eb3fdaf60.png);
}
```
# Info
## Uncompressed
```
Hash: 5be34b0d3c624e61c616
Version: webpack 3.11.0
Asset Size Chunks Chunk Names
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
0.output.js 2.44 kB 0 [emitted]
output.js 21.2 kB 1 [emitted] main
style.css 71 bytes 1 [emitted] main
Entrypoint main = output.js style.css
chunk {0} 0.output.js 1.36 kB {1} [rendered]
> [0] ./example.js 2:0-20
[5] ./chunk.js 26 bytes {0} [built]
amd require ./chunk [0] ./example.js 2:0-20
[6] ./style2.css 1.01 kB {0} [built]
cjs require ./style2.css [5] ./chunk.js 1:0-23
[7] (webpack)/node_modules/css-loader!./style2.css 236 bytes {0} [built]
cjs require !!../../node_modules/css-loader/index.js!./style2.css [6] ./style2.css 4:14-78
[8] ./image2.png 82 bytes {0} [built]
cjs require ./image2.png [7] (webpack)/node_modules/css-loader!./style2.css 6:58-81
chunk {1} output.js, style.css (main) 14.1 kB [entry] [rendered]
> main [0] ./example.js
[0] ./example.js 48 bytes {1} [built]
[1] ./style.css 41 bytes {1} [built]
cjs require ./style.css [0] ./example.js 1:0-22
+ 3 hidden modules
Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin/dist ../../node_modules/css-loader/index.js!style.css:
1 asset
Entrypoint undefined = extract-text-webpack-plugin-output-filename
chunk {0} extract-text-webpack-plugin-output-filename 2.58 kB [entry] [rendered]
> [0] (webpack)/node_modules/css-loader!./style.css
[0] (webpack)/node_modules/css-loader!./style.css 235 bytes {0} [built]
[2] ./image.png 82 bytes {0} [built]
cjs require ./image.png [0] (webpack)/node_modules/css-loader!./style.css 6:58-80
+ 1 hidden module
```
## Minimized (uglify-js, no zip)
```
Hash: edbe0e91ba86d814d855
Version: webpack 3.11.0
Asset Size Chunks Chunk Names
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
0.output.js 343 bytes 0 [emitted]
output.js 6.58 kB 1 [emitted] main
style.css 61 bytes 1 [emitted] main
Entrypoint main = output.js style.css
chunk {0} 0.output.js 1.34 kB {1} [rendered]
> [0] ./example.js 2:0-20
[5] ./chunk.js 26 bytes {0} [built]
amd require ./chunk [0] ./example.js 2:0-20
[6] ./style2.css 1.01 kB {0} [built]
cjs require ./style2.css [5] ./chunk.js 1:0-23
[7] (webpack)/node_modules/css-loader!./style2.css 219 bytes {0} [built]
cjs require !!../../node_modules/css-loader/index.js!./style2.css [6] ./style2.css 4:14-78
[8] ./image2.png 82 bytes {0} [built]
cjs require ./image2.png [7] (webpack)/node_modules/css-loader!./style2.css 6:50-73
chunk {1} output.js, style.css (main) 14.1 kB [entry] [rendered]
> main [0] ./example.js
[0] ./example.js 48 bytes {1} [built]
[1] ./style.css 41 bytes {1} [built]
cjs require ./style.css [0] ./example.js 1:0-22
+ 3 hidden modules
Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin/dist ../../node_modules/css-loader/index.js!style.css:
1 asset
Entrypoint undefined = extract-text-webpack-plugin-output-filename
chunk {0} extract-text-webpack-plugin-output-filename 2.56 kB [entry] [rendered]
> [0] (webpack)/node_modules/css-loader!./style.css
[0] (webpack)/node_modules/css-loader!./style.css 218 bytes {0} [built]
[2] ./image.png 82 bytes {0} [built]
cjs require ./image.png [0] (webpack)/node_modules/css-loader!./style.css 6:50-72
+ 1 hidden module
```

View File

@ -311,7 +311,7 @@ module.exports = function() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 1.86 KiB 0 [emitted]
output.js 7.19 KiB 1 [emitted] main
@ -339,7 +339,7 @@ chunk {1} output.js (main) 261 bytes >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 627 bytes 0 [emitted]
output.js 1.75 KiB 1 [emitted] main

View File

@ -311,7 +311,7 @@ module.exports = function() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 1.86 KiB 0 [emitted]
output.js 7.13 KiB 1 [emitted] main
@ -339,7 +339,7 @@ chunk {1} output.js (main) 276 bytes >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 627 bytes 0 [emitted]
output.js 1.73 KiB 1 [emitted] main

View File

@ -266,7 +266,7 @@ module.exports = "It works";
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 257 bytes 0 [emitted]
output.js 7.56 KiB 1 [emitted] main
@ -287,7 +287,7 @@ chunk {1} output.js (main) 378 bytes >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 98 bytes 0 [emitted]
output.js 1.79 KiB 1 [emitted] main

View File

@ -305,7 +305,7 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 275 bytes 0 [emitted]
1.output.js 284 bytes 1 [emitted]
@ -337,7 +337,7 @@ chunk {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 76 bytes 0 [emitted]
1.output.js 77 bytes 1 [emitted]

View File

@ -321,7 +321,7 @@ getTemplate("baz.noimport");
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 436 bytes 0 [emitted]
1.output.js 445 bytes 1 [emitted]
@ -361,7 +361,7 @@ chunk {3} output.js (main) 618 bytes >{0}< >{1}< >{2}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 113 bytes 0 [emitted]
1.output.js 114 bytes 1 [emitted]

View File

@ -308,7 +308,7 @@ getTemplate("baz");
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 436 bytes 0 [emitted]
1.output.js 445 bytes 1 [emitted]
@ -348,7 +348,7 @@ chunk {3} output.js (main) 456 bytes >{0}< >{1}< >{2}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 113 bytes 0 [emitted]
1.output.js 114 bytes 1 [emitted]

View File

@ -300,7 +300,7 @@ __webpack_require__(3)("./ba" + createContextVar).then(function(bar) {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 445 bytes 0 [emitted] chunk-bar-baz2
1.output.js 439 bytes 1 [emitted] chunk-bar-baz0
@ -340,7 +340,7 @@ chunk {3} output.js (main) 580 bytes >{0}< >{1}< >{2}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 114 bytes 0 [emitted] chunk-bar-baz2
1.output.js 115 bytes 1 [emitted] chunk-bar-baz0

View File

@ -301,7 +301,7 @@ Minimized
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 490 bytes 0 [emitted]
output.js 7.47 KiB 1 [emitted] main
@ -320,7 +320,7 @@ chunk {1} output.js (main) 166 bytes >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 95 bytes 0 [emitted]
output.js 1.68 KiB 1 [emitted] main

View File

@ -153,7 +153,7 @@ module.exports = 42;
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 3.35 KiB 0 [emitted] main
Entrypoint main = output.js
@ -172,7 +172,7 @@ chunk {0} output.js (main) 206 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 708 bytes 0 [emitted] main
Entrypoint main = output.js

View File

@ -49,12 +49,14 @@ module.exports = {
commons: {
chunks: "initial",
minChunks: 2,
maxInitialRequests: 5, // The default limit is too small to showcase the effect
minSize: 0 // This is example is too small to create commons chunks
},
vendor: {
test: /node_modules/,
chunks: "initial",
name: "vendor",
priority: 10,
enforce: true
}
}
@ -70,7 +72,7 @@ module.exports = {
# dist/vendor.js
``` javascript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[5],{
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
/***/ 1:
/*!*********************************!*\
@ -100,7 +102,7 @@ module.exports = "vendor2";
# dist/commons~pageA~pageB~pageC.js
``` javascript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
/***/ 3:
/*!*********************!*\
@ -119,7 +121,7 @@ module.exports = "utility2";
# dist/commons~pageB~pageC.js
``` javascript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[5],{
/***/ 6:
/*!*********************!*\
@ -270,7 +272,7 @@ module.exports = "utility3";
/******/
/******/
/******/ // add entry module to deferred list
/******/ deferredModules.push([0,3,5]);
/******/ deferredModules.push([0,3,4]);
/******/ // run deferred modules when ready
/******/ return checkDeferredModules();
/******/ })
@ -602,7 +604,7 @@ module.exports = "pageB";
/******/
/******/
/******/ // add entry module to deferred list
/******/ deferredModules.push([7,3,4]);
/******/ deferredModules.push([7,4,5]);
/******/ // run deferred modules when ready
/******/ return checkDeferredModules();
/******/ })
@ -632,18 +634,18 @@ module.exports = "pageC";
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
pageA.js 5.6 KiB 0 [emitted] pageA
pageB.js 5.4 KiB 1 [emitted] pageB
pageC.js 5.34 KiB 2 [emitted] pageC
commons~pageA~pageB~pageC.js 269 bytes 3 [emitted] commons~pageA~pageB~pageC
commons~pageB~pageC.js 269 bytes 4 [emitted] commons~pageB~pageC
vendor.js 536 bytes 5 [emitted] vendor
Entrypoint pageA = commons~pageA~pageB~pageC.js vendor.js pageA.js
Entrypoint pageB = commons~pageA~pageB~pageC.js commons~pageB~pageC.js vendor.js pageB.js
vendor.js 536 bytes 3 [emitted] vendor
commons~pageA~pageB~pageC.js 269 bytes 4 [emitted] commons~pageA~pageB~pageC
commons~pageB~pageC.js 269 bytes 5 [emitted] commons~pageB~pageC
Entrypoint pageA = vendor.js commons~pageA~pageB~pageC.js pageA.js
Entrypoint pageB = vendor.js commons~pageA~pageB~pageC.js commons~pageB~pageC.js pageB.js
Entrypoint pageC = commons~pageA~pageB~pageC.js commons~pageB~pageC.js pageC.js
chunk {0} pageA.js (pageA) 170 bytes ={3}= ={5}= [entry] [rendered]
chunk {0} pageA.js (pageA) 170 bytes ={3}= ={4}= [entry] [rendered]
> ./pageA pageA
[0] ./pageA.js 142 bytes {0} [built]
single entry ./pageA pageA
@ -653,72 +655,72 @@ chunk {1} pageB.js (pageB) 142 bytes ={3}= ={4}= ={5}= [entry] [rendered]
> ./pageB pageB
[4] ./pageB.js 142 bytes {1} [built]
single entry ./pageB pageB
chunk {2} pageC.js (pageC) 105 bytes ={3}= ={4}= [entry] [rendered]
chunk {2} pageC.js (pageC) 105 bytes ={4}= ={5}= [entry] [rendered]
> ./pageC pageC
[7] ./pageC.js 105 bytes {2} [built]
single entry ./pageC pageC
chunk {3} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes ={4}= ={2}= ={5}= ={1}= ={0}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageA~pageB~pageC)
> ./pageC pageC
> ./pageB pageB
> ./pageA pageA
[3] ./utility2.js 28 bytes {3} [built]
cjs require ./utility2 [0] ./pageA.js 3:15-36
cjs require ./utility2 [4] ./pageB.js 2:15-36
cjs require ./utility2 [7] ./pageC.js 1:15-36
chunk {4} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={3}= ={2}= ={5}= ={1}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC)
> ./pageC pageC
> ./pageB pageB
[6] ./utility3.js 28 bytes {4} [built]
cjs require ./utility3 [4] ./pageB.js 3:15-36
cjs require ./utility3 [7] ./pageC.js 2:15-36
chunk {5} vendor.js (vendor) 54 bytes ={3}= ={0}= ={4}= ={1}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
chunk {3} vendor.js (vendor) 54 bytes ={0}= ={1}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
> ./pageA pageA
> ./pageB pageB
2 modules
chunk {4} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes ={0}= ={1}= ={2}= ={3}= ={5}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageA~pageB~pageC)
> ./pageA pageA
> ./pageB pageB
> ./pageC pageC
[3] ./utility2.js 28 bytes {4} [built]
cjs require ./utility2 [0] ./pageA.js 3:15-36
cjs require ./utility2 [4] ./pageB.js 2:15-36
cjs require ./utility2 [7] ./pageC.js 1:15-36
chunk {5} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={1}= ={2}= ={3}= ={4}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC)
> ./pageB pageB
> ./pageC pageC
[6] ./utility3.js 28 bytes {5} [built]
cjs require ./utility3 [4] ./pageB.js 3:15-36
cjs require ./utility3 [7] ./pageC.js 2:15-36
```
## Production mode
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
vendor.js 134 bytes 0 [emitted] vendor
commons~pageA~pageB~pageC.js 96 bytes 0 [emitted] commons~pageA~pageB~pageC
commons~pageB~pageC.js 97 bytes 1 [emitted] commons~pageB~pageC
commons~pageA~pageB~pageC.js 96 bytes 2 [emitted] commons~pageA~pageB~pageC
vendor.js 134 bytes 2 [emitted] vendor
pageC.js 1.1 KiB 3 [emitted] pageC
pageB.js 1.11 KiB 4 [emitted] pageB
pageA.js 1.15 KiB 5 [emitted] pageA
Entrypoint pageA = commons~pageA~pageB~pageC.js vendor.js pageA.js
Entrypoint pageB = commons~pageA~pageB~pageC.js commons~pageB~pageC.js vendor.js pageB.js
Entrypoint pageA = vendor.js commons~pageA~pageB~pageC.js pageA.js
Entrypoint pageB = vendor.js commons~pageA~pageB~pageC.js commons~pageB~pageC.js pageB.js
Entrypoint pageC = commons~pageA~pageB~pageC.js commons~pageB~pageC.js pageC.js
chunk {0} vendor.js (vendor) 54 bytes ={2}= ={5}= ={1}= ={4}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
chunk {0} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes ={1}= ={2}= ={3}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageA~pageB~pageC)
> ./pageA pageA
> ./pageB pageB
2 modules
chunk {1} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={2}= ={3}= ={0}= ={4}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC)
> ./pageC pageC
> ./pageB pageB
[1] ./utility3.js 28 bytes {1} [built]
cjs require ./utility3 [2] ./pageC.js 2:15-36
cjs require ./utility3 [4] ./pageB.js 3:15-36
chunk {2} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes ={1}= ={3}= ={0}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageA~pageB~pageC)
> ./pageC pageC
> ./pageB pageB
> ./pageA pageA
[0] ./utility2.js 28 bytes {2} [built]
[0] ./utility2.js 28 bytes {0} [built]
cjs require ./utility2 [2] ./pageC.js 1:15-36
cjs require ./utility2 [4] ./pageB.js 2:15-36
cjs require ./utility2 [7] ./pageA.js 3:15-36
chunk {3} pageC.js (pageC) 105 bytes ={2}= ={1}= [entry] [rendered]
chunk {1} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={0}= ={2}= ={3}= ={4}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC)
> ./pageB pageB
> ./pageC pageC
[1] ./utility3.js 28 bytes {1} [built]
cjs require ./utility3 [2] ./pageC.js 2:15-36
cjs require ./utility3 [4] ./pageB.js 3:15-36
chunk {2} vendor.js (vendor) 54 bytes ={0}= ={1}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
> ./pageA pageA
> ./pageB pageB
2 modules
chunk {3} pageC.js (pageC) 105 bytes ={0}= ={1}= [entry] [rendered]
> ./pageC pageC
[2] ./pageC.js 105 bytes {3} [built]
single entry ./pageC pageC
chunk {4} pageB.js (pageB) 142 bytes ={2}= ={1}= ={0}= [entry] [rendered]
chunk {4} pageB.js (pageB) 142 bytes ={0}= ={1}= ={2}= [entry] [rendered]
> ./pageB pageB
[4] ./pageB.js 142 bytes {4} [built]
single entry ./pageB pageB
chunk {5} pageA.js (pageA) 170 bytes ={2}= ={0}= [entry] [rendered]
chunk {5} pageA.js (pageA) 170 bytes ={0}= ={2}= [entry] [rendered]
> ./pageA pageA
[5] ./utility1.js 28 bytes {5} [built]
cjs require ./utility1 [7] ./pageA.js 2:15-36

View File

@ -13,12 +13,14 @@ module.exports = {
commons: {
chunks: "initial",
minChunks: 2,
maxInitialRequests: 5, // The default limit is too small to showcase the effect
minSize: 0 // This is example is too small to create commons chunks
},
vendor: {
test: /node_modules/,
chunks: "initial",
name: "vendor",
priority: 10,
enforce: true
}
}

View File

@ -430,7 +430,7 @@ module.exports = function() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 340 bytes 0 [emitted]
1.output.js 549 bytes 1 [emitted]
@ -438,9 +438,9 @@ Version: webpack next
3.output.js 414 bytes 3 [emitted]
output.js 7.53 KiB 4 [emitted] main
Entrypoint main = output.js
chunk {0} 0.output.js 72 bytes <{1}> <{4}> ={3}= ={2}= [rendered] split chunk (cache group: default)
> [2] ./pageB.js 3:1-6:3
chunk {0} 0.output.js 72 bytes <{1}> <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default)
> [0] ./example.js 3:1-6:3
> [2] ./pageB.js 3:1-6:3
[4] ./reusableComponent.js 72 bytes {0} [built]
cjs require ./reusableComponent [3] ./pageA.js 1:24-54
cjs require ./reusableComponent [5] ./pageC.js 1:24-54
@ -456,7 +456,7 @@ chunk {3} 3.output.js 142 bytes <{1}> ={0}= [rendered]
> [2] ./pageB.js 3:1-6:3
[5] ./pageC.js 142 bytes {3} [built]
cjs require ./pageC [2] ./pageB.js 4:15-33
chunk {4} output.js (main) 261 bytes >{0}< >{2}< >{1}< [entry] [rendered]
chunk {4} output.js (main) 261 bytes >{0}< >{1}< >{2}< [entry] [rendered]
> main
[0] ./example.js 233 bytes {4} [built]
single entry ./example.js [1] multi ./example.js main:100000
@ -468,7 +468,7 @@ chunk {4} output.js (main) 261 bytes >{0}< >{2}< >{1}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 133 bytes 0 [emitted]
1.output.js 198 bytes 1 [emitted]
@ -476,9 +476,9 @@ Version: webpack next
3.output.js 138 bytes 3 [emitted]
output.js 1.76 KiB 4 [emitted] main
Entrypoint main = output.js
chunk {0} 0.output.js 72 bytes <{1}> <{4}> ={3}= ={2}= [rendered] split chunk (cache group: default)
> [2] ./pageB.js 3:1-6:3
chunk {0} 0.output.js 72 bytes <{1}> <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default)
> [0] ./example.js 3:1-6:3
> [2] ./pageB.js 3:1-6:3
[4] ./reusableComponent.js 72 bytes {0} [built]
cjs require ./reusableComponent [3] ./pageA.js 1:24-54
cjs require ./reusableComponent [5] ./pageC.js 1:24-54
@ -494,7 +494,7 @@ chunk {3} 3.output.js 142 bytes <{1}> ={0}= [rendered]
> [2] ./pageB.js 3:1-6:3
[5] ./pageC.js 142 bytes {3} [built]
cjs require ./pageC [2] ./pageB.js 4:15-33
chunk {4} output.js (main) 261 bytes >{0}< >{2}< >{1}< [entry] [rendered]
chunk {4} output.js (main) 261 bytes >{0}< >{1}< >{2}< [entry] [rendered]
> main
[0] ./example.js 233 bytes {4} [built]
single entry ./example.js [1] multi ./example.js main:100000

View File

@ -167,7 +167,7 @@ exports.add = function() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 3.44 KiB 0 [emitted] main
Entrypoint main = output.js
@ -185,7 +185,7 @@ chunk {0} output.js (main) 329 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 740 bytes 0 [emitted] main
Entrypoint main = output.js

View File

@ -166,7 +166,7 @@ function square(n) {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
vendor.js 3.32 KiB 0 [emitted] main
Entrypoint main = vendor.js
@ -182,7 +182,7 @@ chunk {0} vendor.js (main) 60 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
vendor.js 704 bytes 0 [emitted] main
Entrypoint main = vendor.js

View File

@ -174,7 +174,7 @@ module.exports = vendor_lib_9ee2f174307b7ef21301;
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
app.js 3.9 KiB 0 [emitted] main
Entrypoint main = app.js
@ -196,7 +196,7 @@ chunk {0} app.js (main) 182 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
app.js 736 bytes 0 [emitted] main
Entrypoint main = app.js

View File

@ -227,7 +227,7 @@ module.exports = (__webpack_require__(/*! dll-reference alpha_ae937b5d3e880b635a
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 6.19 KiB 0 [emitted] main
Entrypoint main = output.js
@ -261,7 +261,7 @@ chunk {0} output.js (main) 549 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 972 bytes 0 [emitted] main
Entrypoint main = output.js

View File

@ -177,7 +177,7 @@ module.exports = "module";
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
MyDll.alpha.js 3.46 KiB 0 [emitted] alpha
MyDll.beta.js 3.43 KiB 1 [emitted] beta
@ -215,7 +215,7 @@ chunk {1} MyDll.beta.js (beta) 80 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
MyDll.beta.js 691 bytes 0 [emitted] beta
MyDll.alpha.js 700 bytes 1 [emitted] alpha

View File

@ -281,7 +281,7 @@ module.exports = vendor_36000db9190edee14765;
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Child vendor:
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
@ -335,7 +335,7 @@ Child app:
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Child vendor:
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names

View File

@ -183,7 +183,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 4.17 KiB 0 [emitted] main
Entrypoint main = output.js
@ -201,7 +201,7 @@ chunk {0} output.js (main) 197 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 1.02 KiB 0 [emitted] main
Entrypoint main = output.js

View File

@ -228,9 +228,9 @@ module.exports = {
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
Promise.all(/*! AMD require */[__webpack_require__.e(0), __webpack_require__.e(1), __webpack_require__.e(4)]).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(/*! ./a */ 1), __webpack_require__(/*! ./b */ 0), __webpack_require__(/*! ./c */ 7)]; (function(a, b, c) {}).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);}).catch(__webpack_require__.oe);
Promise.all(/*! AMD require */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(4)]).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(/*! ./a */ 1), __webpack_require__(/*! ./b */ 0), __webpack_require__(/*! ./c */ 7)]; (function(a, b, c) {}).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);}).catch(__webpack_require__.oe);
Promise.all(/*! require.ensure */[__webpack_require__.e(0), __webpack_require__.e(1), __webpack_require__.e(3)]).then((function(require) {
Promise.all(/*! require.ensure */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(3)]).then((function(require) {
__webpack_require__(/*! ./b */ 0);
__webpack_require__(/*! ./d */ 6);
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
@ -257,7 +257,7 @@ Promise.all(/*! require.ensure */[__webpack_require__.e(0), __webpack_require__.
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 247 bytes 0 [emitted]
1.output.js 238 bytes 1 [emitted]
@ -268,20 +268,20 @@ Version: webpack next
6.output.js 241 bytes 6 [emitted]
output.js 8.07 KiB 7 [emitted] main
Entrypoint main = output.js
chunk {0} 0.output.js 21 bytes <{7}> ={2}= ={1}= ={3}= ={4}= >{1}< >{5}< >{6}< [rendered] split chunk (cache group: default)
> [2] ./example.js 8:0-16:2
> [2] ./example.js 3:0-6:2
chunk {0} 0.output.js 21 bytes <{7}> ={1}= ={2}= ={3}= ={4}= >{1}< >{5}< >{6}< [rendered] split chunk (cache group: default)
> ./a ./b ./c [2] ./example.js 1:0-52
> [2] ./example.js 3:0-6:2
> [2] ./example.js 8:0-16:2
[1] ./a.js 21 bytes {0} [built]
amd require ./a [2] ./example.js 1:0-52
require.ensure item ./a [2] ./example.js 3:0-6:2
require.ensure item ./a [2] ./example.js 8:0-16:2
cjs require ./a [2] ./example.js 9:1-15
chunk {1} 1.output.js 21 bytes <{0}> <{2}> <{7}> ={5}= ={6}= ={0}= ={3}= ={4}= [rendered] split chunk (cache group: default)
> [2] ./example.js 13:1-15:3
chunk {1} 1.output.js 21 bytes <{0}> <{2}> <{7}> ={0}= ={3}= ={4}= ={5}= ={6}= [rendered] split chunk (cache group: default)
> [2] ./example.js 10:1-12:3
> [2] ./example.js 3:0-6:2
> [2] ./example.js 13:1-15:3
> ./a ./b ./c [2] ./example.js 1:0-52
> [2] ./example.js 3:0-6:2
[0] ./b.js 21 bytes {1} [built]
amd require ./b [2] ./example.js 1:0-52
cjs require ./b [2] ./example.js 4:1-15
@ -307,7 +307,7 @@ chunk {6} 6.output.js 21 bytes <{0}> <{2}> ={1}= [rendered]
> [2] ./example.js 10:1-12:3
[4] ./f.js 21 bytes {6} [built]
cjs require ./f [2] ./example.js 11:2-16
chunk {7} output.js (main) 362 bytes >{0}< >{1}< >{3}< >{4}< >{2}< [entry] [rendered]
chunk {7} output.js (main) 362 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered]
> .\example.js main
[2] ./example.js 362 bytes {7} [built]
single entry .\example.js main
@ -317,7 +317,7 @@ chunk {7} output.js (main) 362 bytes >{0}< >{1}< >{3}< >{4}< >{2}< [entry] [r
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 90 bytes 0 [emitted]
1.output.js 89 bytes 1 [emitted]
@ -328,20 +328,20 @@ Version: webpack next
6.output.js 91 bytes 6 [emitted]
output.js 2.02 KiB 7 [emitted] main
Entrypoint main = output.js
chunk {0} 0.output.js 21 bytes <{7}> ={2}= ={1}= ={3}= ={4}= >{1}< >{5}< >{6}< [rendered] split chunk (cache group: default)
> [2] ./example.js 8:0-16:2
> [2] ./example.js 3:0-6:2
chunk {0} 0.output.js 21 bytes <{7}> ={1}= ={2}= ={3}= ={4}= >{1}< >{5}< >{6}< [rendered] split chunk (cache group: default)
> ./a ./b ./c [2] ./example.js 1:0-52
> [2] ./example.js 3:0-6:2
> [2] ./example.js 8:0-16:2
[1] ./a.js 21 bytes {0} [built]
amd require ./a [2] ./example.js 1:0-52
require.ensure item ./a [2] ./example.js 3:0-6:2
require.ensure item ./a [2] ./example.js 8:0-16:2
cjs require ./a [2] ./example.js 9:1-15
chunk {1} 1.output.js 21 bytes <{0}> <{2}> <{7}> ={5}= ={6}= ={0}= ={3}= ={4}= [rendered] split chunk (cache group: default)
> [2] ./example.js 13:1-15:3
chunk {1} 1.output.js 21 bytes <{0}> <{2}> <{7}> ={0}= ={3}= ={4}= ={5}= ={6}= [rendered] split chunk (cache group: default)
> [2] ./example.js 10:1-12:3
> [2] ./example.js 3:0-6:2
> [2] ./example.js 13:1-15:3
> ./a ./b ./c [2] ./example.js 1:0-52
> [2] ./example.js 3:0-6:2
[0] ./b.js 21 bytes {1} [built]
amd require ./b [2] ./example.js 1:0-52
cjs require ./b [2] ./example.js 4:1-15
@ -367,7 +367,7 @@ chunk {6} 6.output.js 21 bytes <{0}> <{2}> ={1}= [rendered]
> [2] ./example.js 10:1-12:3
[4] ./f.js 21 bytes {6} [built]
cjs require ./f [2] ./example.js 11:2-16
chunk {7} output.js (main) 362 bytes >{0}< >{1}< >{3}< >{4}< >{2}< [entry] [rendered]
chunk {7} output.js (main) 362 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered]
> .\example.js main
[2] ./example.js 362 bytes {7} [built]
single entry .\example.js main

View File

@ -324,7 +324,7 @@ module.exports = "c";
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 405 bytes 0 [emitted]
1.output.js 241 bytes 1 [emitted]
@ -332,8 +332,8 @@ Version: webpack next
output.js 7.32 KiB 3 [emitted] main
Entrypoint main = output.js
chunk {0} 0.output.js 42 bytes <{3}> ={1}= ={2}= [rendered] split chunk (cache group: default)
> [2] ./example.js 5:0-8:2
> ./a ./b ./c [2] ./example.js 2:0-30
> [2] ./example.js 5:0-8:2
[0] ./b.js 21 bytes {0} [built]
amd require ./b [2] ./example.js 2:0-30
cjs require ./b [2] ./example.js 6:1-15
@ -358,7 +358,7 @@ chunk {3} output.js (main) 172 bytes >{0}< >{1}< >{2}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 118 bytes 0 [emitted]
1.output.js 91 bytes 1 [emitted]
@ -366,8 +366,8 @@ Version: webpack next
output.js 1.73 KiB 3 [emitted] main
Entrypoint main = output.js
chunk {0} 0.output.js 42 bytes <{3}> ={1}= ={2}= [rendered] split chunk (cache group: default)
> [2] ./example.js 5:0-8:2
> ./a ./b ./c [2] ./example.js 2:0-30
> [2] ./example.js 5:0-8:2
[0] ./b.js 21 bytes {0} [built]
amd require ./b [2] ./example.js 2:0-30
cjs require ./b [2] ./example.js 6:1-15

View File

@ -260,7 +260,7 @@ var named = "named";
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 6.13 KiB 0 [emitted] main
Entrypoint main = output.js
@ -292,7 +292,7 @@ chunk {0} output.js (main) 1.17 KiB [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 993 bytes 0 [emitted] main
Entrypoint main = output.js

View File

@ -137,7 +137,7 @@ function increment() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
MyLibrary.umd.js 3.56 KiB 0 [emitted] main
Entrypoint main = MyLibrary.umd.js
@ -152,7 +152,7 @@ chunk {0} MyLibrary.umd.js (main) 97 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
MyLibrary.umd.js 926 bytes 0 [emitted] main
Entrypoint main = MyLibrary.umd.js

View File

@ -240,7 +240,7 @@ function c() { console.log("c"); }
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 5.93 KiB 0 [emitted] main
Entrypoint main = output.js
@ -272,7 +272,7 @@ chunk {0} output.js (main) 726 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 971 bytes 0 [emitted] main
Entrypoint main = output.js

View File

@ -274,7 +274,7 @@ __webpack_require__.e(/*! import() */ 0).then(__webpack_require__.bind(null, /*!
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 479 bytes 0 [emitted]
output.js 8.27 KiB 1 [emitted] main
@ -303,7 +303,7 @@ chunk {1} output.js (main) 419 bytes >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 144 bytes 0 [emitted]
output.js 1.75 KiB 1 [emitted] main

View File

@ -47,7 +47,7 @@ module.exports = {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
aae9c6dac629dd3f112e.js 54.5 KiB 7 [emitted]
07ed7b2dfa6fe5502719.js 34.8 KiB 0 [emitted]
@ -65,50 +65,50 @@ ee6461bbec846ab2c762.js 37.6 KiB 10 [emitted]
5ec04d5529f6b78241e2.js 51.9 KiB 13 [emitted]
38a6975540caa0156886.js 51.3 KiB 14 [emitted]
Entrypoint main = bc5ed8b126130fde4f42.js 2a784b823ab0da1e0293.js 07ed7b2dfa6fe5502719.js
chunk {0} 07ed7b2dfa6fe5502719.js 28.3 KiB ={3}= ={5}= >{2}< >{4}< >{6}< >{7}< >{8}< >{9}< >{10}< >{11}< >{12}< >{13}< >{14}< >{1}< [entry] [rendered]
chunk {0} 07ed7b2dfa6fe5502719.js 28.3 KiB ={3}= ={5}= >{1}< >{10}< >{11}< >{12}< >{13}< >{14}< >{2}< >{4}< >{6}< >{7}< >{8}< >{9}< [entry] [rendered]
> ./example main
[0] ./example.js 44 bytes {0} [built]
+ 13 hidden modules
chunk {1} 3147c249192926fa3521.js 24.9 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= ={10}= ={11}= ={12}= ={13}= ={14}= [rendered]
chunk {1} 3147c249192926fa3521.js 24.9 KiB <{0}> <{3}> <{5}> ={10}= ={11}= ={12}= ={13}= ={14}= ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= [rendered]
> react-dom [0] ./example.js 2:0-22
3 modules
chunk {2} 987f929f287f8a6c88ac.js 45.7 KiB <{3}> <{5}> <{0}> ={4}= ={6}= ={7}= ={8}= ={9}= ={10}= ={11}= ={12}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {2} 987f929f287f8a6c88ac.js 45.7 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={12}= ={13}= ={14}= ={4}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
23 modules
chunk {3} bc5ed8b126130fde4f42.js 37.8 KiB ={5}= ={0}= >{2}< >{4}< >{6}< >{7}< >{8}< >{9}< >{10}< >{11}< >{12}< >{13}< >{14}< >{1}< [initial] [rendered] [recorded] aggressive splitted
chunk {3} bc5ed8b126130fde4f42.js 37.8 KiB ={0}= ={5}= >{1}< >{10}< >{11}< >{12}< >{13}< >{14}< >{2}< >{4}< >{6}< >{7}< >{8}< >{9}< [initial] [rendered] [recorded] aggressive splitted
> ./example main
8 modules
chunk {4} 511009f3a8f06b7c54cb.js 46.9 KiB <{3}> <{5}> <{0}> ={2}= ={6}= ={7}= ={8}= ={9}= ={10}= ={11}= ={12}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {4} 511009f3a8f06b7c54cb.js 46.9 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={12}= ={13}= ={14}= ={2}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
8 modules
chunk {5} 2a784b823ab0da1e0293.js 45.7 KiB ={3}= ={0}= >{2}< >{4}< >{6}< >{7}< >{8}< >{9}< >{10}< >{11}< >{12}< >{13}< >{14}< >{1}< [initial] [rendered] [recorded] aggressive splitted
chunk {5} 2a784b823ab0da1e0293.js 45.7 KiB ={0}= ={3}= >{1}< >{10}< >{11}< >{12}< >{13}< >{14}< >{2}< >{4}< >{6}< >{7}< >{8}< >{9}< [initial] [rendered] [recorded] aggressive splitted
> ./example main
9 modules
chunk {6} 0abfd767d2250ac9265a.js 46.3 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={7}= ={8}= ={9}= ={10}= ={11}= ={12}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {6} 0abfd767d2250ac9265a.js 46.3 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={12}= ={13}= ={14}= ={2}= ={4}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
10 modules
chunk {7} aae9c6dac629dd3f112e.js 62.3 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={8}= ={9}= ={10}= ={11}= ={12}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {7} aae9c6dac629dd3f112e.js 62.3 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={12}= ={13}= ={14}= ={2}= ={4}= ={6}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
7 modules
chunk {8} cd98376ec90f2e366b94.js 43.3 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={7}= ={9}= ={10}= ={11}= ={12}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {8} cd98376ec90f2e366b94.js 43.3 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={12}= ={13}= ={14}= ={2}= ={4}= ={6}= ={7}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
3 modules
chunk {9} a0f973cb054f411fba45.js 44.4 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={7}= ={8}= ={10}= ={11}= ={12}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {9} a0f973cb054f411fba45.js 44.4 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={12}= ={13}= ={14}= ={2}= ={4}= ={6}= ={7}= ={8}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
10 modules
chunk {10} ee6461bbec846ab2c762.js 34 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= ={11}= ={12}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {10} ee6461bbec846ab2c762.js 34 KiB <{0}> <{3}> <{5}> ={1}= ={11}= ={12}= ={13}= ={14}= ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
16 modules
chunk {11} 74249374b007623d16bf.js 48.4 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= ={10}= ={12}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {11} 74249374b007623d16bf.js 48.4 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={12}= ={13}= ={14}= ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
6 modules
chunk {12} 0a6d10836900825087ce.js 46.2 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= ={10}= ={11}= ={13}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {12} 0a6d10836900825087ce.js 46.2 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={13}= ={14}= ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
9 modules
chunk {13} 5ec04d5529f6b78241e2.js 48.2 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= ={10}= ={11}= ={12}= ={14}= ={1}= [rendered] [recorded] aggressive splitted
chunk {13} 5ec04d5529f6b78241e2.js 48.2 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={12}= ={14}= ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
20 modules
chunk {14} 38a6975540caa0156886.js 46.6 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= ={10}= ={11}= ={12}= ={13}= ={1}= [rendered] [recorded] aggressive splitted
chunk {14} 38a6975540caa0156886.js 46.6 KiB <{0}> <{3}> <{5}> ={1}= ={10}= ={11}= ={12}= ={13}= ={2}= ={4}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [0] ./example.js 2:0-22
24 modules
```
@ -117,10 +117,10 @@ chunk {14} 38a6975540caa0156886.js 46.6 KiB <{3}> <{5}> <{0}> ={2}= ={4}= ={6}
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
7a1ec67d9e4e1019836a.js 14.8 KiB 7 [emitted]
9baaf7bc0364c2600ef8.js 9.69 KiB 0 [emitted]
9baaf7bc0364c2600ef8.js 9.7 KiB 0 [emitted]
cf3beff30352265c3fae.js 13.1 KiB 2 [emitted]
0bc9e49d2884c20a78ae.js 7.89 KiB 3 [emitted]
408e20e95f946dedfdd3.js 8.14 KiB 4 [emitted]
@ -135,49 +135,49 @@ f9403b4474b02c436f23.js 10.9 KiB 12 [emitted]
97ad3a6439b7ef8470ec.js 6.41 KiB 13 [emitted]
ed199e2ef66607136e6a.js 5.97 KiB 14 [emitted]
Entrypoint main = 97ad3a6439b7ef8470ec.js f9403b4474b02c436f23.js ed199e2ef66607136e6a.js
chunk {0} 9baaf7bc0364c2600ef8.js 46.6 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={7}= ={6}= ={5}= ={4}= ={3}= ={2}= ={1}= ={11}= [rendered] [recorded] aggressive splitted
chunk {0} 9baaf7bc0364c2600ef8.js 46.6 KiB <{12}> <{13}> <{14}> ={1}= ={10}= ={11}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
24 modules
chunk {1} 148bbb5ef8fd203f5c99.js 48.2 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={7}= ={6}= ={5}= ={4}= ={3}= ={2}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {1} 148bbb5ef8fd203f5c99.js 48.2 KiB <{12}> <{13}> <{14}> ={0}= ={10}= ={11}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
20 modules
chunk {2} cf3beff30352265c3fae.js 46.2 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={7}= ={6}= ={5}= ={4}= ={3}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {2} cf3beff30352265c3fae.js 46.2 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={11}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
9 modules
chunk {3} 0bc9e49d2884c20a78ae.js 48.4 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={7}= ={6}= ={5}= ={4}= ={2}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {3} 0bc9e49d2884c20a78ae.js 48.4 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={11}= ={2}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
6 modules
chunk {4} 408e20e95f946dedfdd3.js 34 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={7}= ={6}= ={5}= ={3}= ={2}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {4} 408e20e95f946dedfdd3.js 34 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={11}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
16 modules
chunk {5} 5b44ef86854beead5c79.js 44.4 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={7}= ={6}= ={4}= ={3}= ={2}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {5} 5b44ef86854beead5c79.js 44.4 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={11}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
10 modules
chunk {6} 2d761db260e810943d04.js 43.3 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={7}= ={5}= ={4}= ={3}= ={2}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {6} 2d761db260e810943d04.js 43.3 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={11}= ={2}= ={3}= ={4}= ={5}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
3 modules
chunk {7} 7a1ec67d9e4e1019836a.js 62.3 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={6}= ={5}= ={4}= ={3}= ={2}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {7} 7a1ec67d9e4e1019836a.js 62.3 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={11}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
7 modules
chunk {8} 5efec1104bcbe14efad9.js 46.3 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={7}= ={6}= ={5}= ={4}= ={3}= ={2}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {8} 5efec1104bcbe14efad9.js 46.3 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={11}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
10 modules
chunk {9} 050d4b543b70cc78b255.js 46.9 KiB <{13}> <{12}> <{14}> ={10}= ={8}= ={7}= ={6}= ={5}= ={4}= ={3}= ={2}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {9} 050d4b543b70cc78b255.js 46.9 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={11}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
8 modules
chunk {10} 2c42126f0455b98de2d0.js 45.7 KiB <{13}> <{12}> <{14}> ={9}= ={8}= ={7}= ={6}= ={5}= ={4}= ={3}= ={2}= ={1}= ={0}= ={11}= [rendered] [recorded] aggressive splitted
chunk {10} 2c42126f0455b98de2d0.js 45.7 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={11}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= [rendered] [recorded] aggressive splitted
> react-dom [30] ./example.js 2:0-22
23 modules
chunk {11} 27d8a7d99dbd33243169.js 24.9 KiB <{13}> <{12}> <{14}> ={10}= ={9}= ={8}= ={7}= ={6}= ={5}= ={4}= ={3}= ={2}= ={1}= ={0}= [rendered]
chunk {11} 27d8a7d99dbd33243169.js 24.9 KiB <{12}> <{13}> <{14}> ={0}= ={1}= ={10}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= [rendered]
> react-dom [30] ./example.js 2:0-22
3 modules
chunk {12} f9403b4474b02c436f23.js 45.7 KiB ={13}= ={14}= >{10}< >{9}< >{8}< >{7}< >{6}< >{5}< >{4}< >{3}< >{2}< >{1}< >{0}< >{11}< [initial] [rendered] [recorded] aggressive splitted
chunk {12} f9403b4474b02c436f23.js 45.7 KiB ={13}= ={14}= >{0}< >{1}< >{10}< >{11}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< >{8}< >{9}< [initial] [rendered] [recorded] aggressive splitted
> ./example main
9 modules
chunk {13} 97ad3a6439b7ef8470ec.js 37.8 KiB ={12}= ={14}= >{10}< >{9}< >{8}< >{7}< >{6}< >{5}< >{4}< >{3}< >{2}< >{1}< >{0}< >{11}< [initial] [rendered] [recorded] aggressive splitted
chunk {13} 97ad3a6439b7ef8470ec.js 37.8 KiB ={12}= ={14}= >{0}< >{1}< >{10}< >{11}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< >{8}< >{9}< [initial] [rendered] [recorded] aggressive splitted
> ./example main
8 modules
chunk {14} ed199e2ef66607136e6a.js 28.3 KiB ={13}= ={12}= >{10}< >{9}< >{8}< >{7}< >{6}< >{5}< >{4}< >{3}< >{2}< >{1}< >{0}< >{11}< [entry] [rendered]
chunk {14} ed199e2ef66607136e6a.js 28.3 KiB ={12}= ={13}= >{0}< >{1}< >{10}< >{11}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< >{8}< >{9}< [entry] [rendered]
> ./example main
[30] ./example.js 44 bytes {14} [built]
+ 13 hidden modules

View File

@ -369,7 +369,7 @@ module.exports = webpackAsyncContext;
/******/
/******/
/******/ // add entry module to deferred list
/******/ deferredModules.push([8,1,2]);
/******/ deferredModules.push([8,2,1]);
/******/ // run deferred modules when ready
/******/ return checkDeferredModules();
/******/ })
@ -437,32 +437,32 @@ module.exports = function() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
bPage.chunk.js 299 bytes 0 [emitted] bPage
aPage.chunk.js 293 bytes 1 [emitted] aPage
pageA~pageB.chunk.js 2.16 KiB 2 [emitted] pageA~pageB
pageB.bundle.js 8.2 KiB 3 [emitted] pageB
pageA.bundle.js 8.2 KiB 4 [emitted] pageA
Entrypoint pageA = aPage.chunk.js pageA~pageB.chunk.js pageA.bundle.js
Entrypoint pageB = bPage.chunk.js pageA~pageB.chunk.js pageB.bundle.js
Entrypoint pageA = pageA~pageB.chunk.js aPage.chunk.js pageA.bundle.js
Entrypoint pageB = pageA~pageB.chunk.js bPage.chunk.js pageB.bundle.js
chunk {0} bPage.chunk.js (bPage) 61 bytes <{1}> <{2}> <{4}> ={2}= ={3}= >{1}< [initial] [rendered] reused as split chunk (cache group: default)
> ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
> ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
> pageB
> ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
> ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
[1] ./bPage.js 61 bytes {0} [built]
cjs require ./bPage [4] ./bEntry.js 3:7-25
context element ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
chunk {1} aPage.chunk.js (aPage) 61 bytes <{0}> <{2}> <{3}> ={2}= ={4}= >{0}< [initial] [rendered] reused as split chunk (cache group: default)
> ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
> ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
> pageA
> ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
> ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
[3] ./aPage.js 61 bytes {1} [built]
context element ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
cjs require ./aPage [7] ./aEntry.js 3:7-25
chunk {2} pageA~pageB.chunk.js (pageA~pageB) 970 bytes ={0}= ={3}= ={1}= ={4}= >{1}< >{0}< [initial] [rendered] split chunk (cache group: default) (name: pageA~pageB)
> pageB
chunk {2} pageA~pageB.chunk.js (pageA~pageB) 970 bytes ={0}= ={1}= ={3}= ={4}= >{0}< >{1}< [initial] [rendered] split chunk (cache group: default) (name: pageA~pageB)
> pageA
> pageB
[0] ./render.js 60 bytes {2} [built]
cjs require ./render [2] ./router.js 1:13-32
cjs require ./render [4] ./bEntry.js 2:13-32
@ -490,32 +490,32 @@ chunk {4} pageA.bundle.js (pageA) 129 bytes ={1}= ={2}= >{0}< [entry] [render
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
bPage.chunk.js 122 bytes 0 [emitted] bPage
aPage.chunk.js 123 bytes 1 [emitted] aPage
pageA~pageB.chunk.js 589 bytes 2 [emitted] pageA~pageB
pageB.bundle.js 1.85 KiB 3 [emitted] pageB
pageA.bundle.js 1.85 KiB 4 [emitted] pageA
Entrypoint pageA = aPage.chunk.js pageA~pageB.chunk.js pageA.bundle.js
Entrypoint pageB = bPage.chunk.js pageA~pageB.chunk.js pageB.bundle.js
Entrypoint pageA = pageA~pageB.chunk.js aPage.chunk.js pageA.bundle.js
Entrypoint pageB = pageA~pageB.chunk.js bPage.chunk.js pageB.bundle.js
chunk {0} bPage.chunk.js (bPage) 61 bytes <{1}> <{2}> <{4}> ={2}= ={3}= >{1}< [initial] [rendered] reused as split chunk (cache group: default)
> ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
> ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
> pageB
> ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
> ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
[1] ./bPage.js 61 bytes {0} [built]
cjs require ./bPage [4] ./bEntry.js 3:7-25
context element ./bPage [6] . lazy ^\.\/.*Page$ namespace object ./bPage
chunk {1} aPage.chunk.js (aPage) 61 bytes <{0}> <{2}> <{3}> ={2}= ={4}= >{0}< [initial] [rendered] reused as split chunk (cache group: default)
> ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
> ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
> pageA
> ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
> ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
[3] ./aPage.js 61 bytes {1} [built]
context element ./aPage [6] . lazy ^\.\/.*Page$ namespace object ./aPage
cjs require ./aPage [7] ./aEntry.js 3:7-25
chunk {2} pageA~pageB.chunk.js (pageA~pageB) 970 bytes ={0}= ={3}= ={1}= ={4}= >{1}< >{0}< [initial] [rendered] split chunk (cache group: default) (name: pageA~pageB)
> pageB
chunk {2} pageA~pageB.chunk.js (pageA~pageB) 970 bytes ={0}= ={1}= ={3}= ={4}= >{0}< >{1}< [initial] [rendered] split chunk (cache group: default) (name: pageA~pageB)
> pageA
> pageB
[0] ./render.js 60 bytes {2} [built]
cjs require ./render [2] ./router.js 1:13-32
cjs require ./render [4] ./bEntry.js 2:13-32

View File

@ -238,7 +238,7 @@ console.log("Missing Text");
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Child en:
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
@ -266,7 +266,7 @@ Child de:
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Child en:
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names

View File

@ -263,7 +263,7 @@ Prints in node.js (`enhanced-require example.js`) and in browser:
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 6.2 KiB 0 [emitted] main
Entrypoint main = output.js
@ -283,7 +283,7 @@ chunk {0} output.js (main) 2.66 KiB [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 1.53 KiB 0 [emitted] main
Entrypoint main = output.js

View File

@ -409,7 +409,7 @@ module.exports = function() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 1.87 KiB 0 [emitted]
output.js 9.76 KiB 1 [emitted] main
@ -455,7 +455,7 @@ chunk {1} output.js (main) 1.03 KiB >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 606 bytes 0 [emitted]
output.js 2.04 KiB 1 [emitted] main

View File

@ -251,7 +251,7 @@ console.log("Running " + "mobile" + " build");
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Child mobile:
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
@ -278,7 +278,7 @@ Child desktop:
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Child mobile:
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names

View File

@ -245,7 +245,7 @@ module.exports = "beta";
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
MyLibrary.alpha.js 3.16 KiB 0 [emitted] alpha
MyLibrary.beta.js 3.16 KiB 1 [emitted] beta
@ -265,7 +265,7 @@ chunk {1} MyLibrary.beta.js (beta) 24 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
MyLibrary.beta.js 828 bytes 0 [emitted] beta
MyLibrary.alpha.js 832 bytes 1 [emitted] alpha

View File

@ -4,15 +4,15 @@ In this example you have two (HTML) pages `pageA` and `pageB`. You want to creat
You can see how to define multiple entry points via the `entry` option.
You can use
You can use
You can see the output files:
* `commons.js` contains:
* the module system
* chunk loading logic
* module `common.js` which is used in both pages
* `pageA.js` contains: (`pageB.js` is similar)
* the module system
* chunk loading logic
* the entry point `pageA.js`
* it would contain any other module that is only used by `pageA`
* `0.chunk.js` is an additional chunk which is used by both pages. It contains:
@ -572,7 +572,7 @@ module.exports = function(msg) {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.1
Asset Size Chunks Chunk Names
0.js 363 bytes 0 [emitted]
commons.js 267 bytes 1 [emitted] commons
@ -608,7 +608,7 @@ chunk {3} pageA.js (pageA) 108 bytes ={1}= >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.1
Asset Size Chunks Chunk Names
0.js 120 bytes 0 [emitted]
commons.js 95 bytes 1 [emitted] commons

View File

@ -4,15 +4,15 @@ In this example you have two (HTML) pages `pageA` and `pageB`. You want to creat
You can see how to define multiple entry points via the `entry` option.
You can use
You can use
You can see the output files:
* `commons.js` contains:
* the module system
* chunk loading logic
* module `common.js` which is used in both pages
* `pageA.js` contains: (`pageB.js` is similar)
* the module system
* chunk loading logic
* the entry point `pageA.js`
* it would contain any other module that is only used by `pageA`
* `0.chunk.js` is an additional chunk which is used by both pages. It contains:

View File

@ -326,7 +326,7 @@ __webpack_require__.e(/*! require.ensure */ 0).then((function(require) {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 463 bytes 0 [emitted]
1.output.js 677 bytes 1 [emitted] my own chunk
@ -336,9 +336,9 @@ chunk {0} 0.output.js 22 bytes <{2}> [rendered]
> [3] ./example.js 17:0-20:2
2 modules
chunk {1} 1.output.js (my own chunk) 33 bytes <{2}> [rendered]
> [3] ./example.js 13:0-15:18
> [3] ./example.js 3:0-6:18
> [3] ./example.js 8:0-11:18
> [3] ./example.js 13:0-15:18
3 modules
chunk {2} output.js (main) 452 bytes >{0}< >{1}< [entry] [rendered]
> .\example.js main
@ -351,7 +351,7 @@ chunk {2} output.js (main) 452 bytes >{0}< >{1}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 92 bytes 0 [emitted]
1.output.js 112 bytes 1, 0 [emitted] my own chunk
@ -361,9 +361,9 @@ chunk {0} 0.output.js 22 bytes <{2}> [rendered]
> [3] ./example.js 17:0-20:2
2 modules
chunk {1} 1.output.js (my own chunk) 33 bytes <{2}> [rendered]
> [3] ./example.js 13:0-15:18
> [3] ./example.js 3:0-6:18
> [3] ./example.js 8:0-11:18
> [3] ./example.js 13:0-15:18
3 modules
chunk {2} output.js (main) 452 bytes >{0}< >{1}< [entry] [rendered]
> .\example.js main

View File

@ -202,7 +202,7 @@ module.exports = function() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 4.48 KiB 0 [emitted] main
Entrypoint main = output.js
@ -227,7 +227,7 @@ chunk {0} output.js (main) 613 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 1.16 KiB 0 [emitted] main
Entrypoint main = output.js

View File

@ -146,7 +146,7 @@ module.exports = Math.random();
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 3.26 KiB 0 [emitted] main
Entrypoint main = output.js
@ -164,7 +164,7 @@ chunk {0} output.js (main) 326 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 667 bytes 0 [emitted] main
Entrypoint main = output.js

View File

@ -439,7 +439,7 @@ Minimized
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 1.78 KiB 0 [emitted]
output.js 8.2 KiB 1 [emitted] main
@ -478,7 +478,7 @@ chunk {1} output.js (main) 390 bytes >{0}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 362 bytes 0 [emitted]
output.js 1.8 KiB 1 [emitted] main

View File

@ -298,7 +298,7 @@ const c = "c";
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 7.91 KiB 0 [emitted] main
Entrypoint main = output.js
@ -314,7 +314,7 @@ chunk {0} output.js (main) 443 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
output.js 600 bytes 0 [emitted] main
Entrypoint main = output.js

View File

@ -84,7 +84,7 @@ race = function() {
```
``` javascript
{"version":3,"sources":["webpack:///./example.coffee"],"names":[],"mappings":";;;;;;;;AAGA;EAAA;;AAAA,OACE;EAAA,MAAQ,IAAI,CAAC,IAAb;EACA,QAAQ,MADR;EAEA,MAAQ,SAAC,CAAD;WAAO,IAAI,OAAO,CAAP;EAAX,CAFR;;;AAKF,OAAO;AACL;EADM,uBAAQ;SACd,MAAM,MAAN,EAAc,OAAd;AADK","file":"./bundle-source-map.js","sourcesContent":["# Taken from http://coffeescript.org/\r\n\r\n# Objects:\r\nmath =\r\n root: Math.sqrt\r\n square: square\r\n cube: (x) -> x * square x\r\n\r\n# Splats:\r\nrace = (winner, runners...) ->\r\n print winner, runners\r\n\n\n\n// WEBPACK FOOTER //\n// ./example.coffee"],"sourceRoot":""}
{"version":3,"sources":["webpack:///./example.coffee"],"names":[],"mappings":";;;;;;;;AAGA;EAAA;;AAAA,OACE;EAAA,MAAQ,IAAI,CAAC,IAAb;EACA,QAAQ,MADR;EAEA,MAAQ,SAAC,CAAD;WAAO,IAAI,OAAO,CAAP;EAAX,CAFR;;;AAKF,OAAO;AACL;EADM,uBAAQ;SACd,MAAM,MAAN,EAAc,OAAd;AADK","file":"./bundle-source-map.js","sourcesContent":["# Taken from http://coffeescript.org/\r\n\r\n# Objects:\r\nmath =\r\n root: Math.sqrt\r\n square: square\r\n cube: (x) -> x * square x\r\n\r\n# Splats:\r\nrace = (winner, runners...) ->\r\n print winner, runners\r\n"],"sourceRoot":""}
```
## hidden-source-map.js and hidden-source-map.js.map
@ -120,7 +120,7 @@ race = function() {
```
``` javascript
{"version":3,"sources":["webpack:///./example.coffee"],"names":[],"mappings":";;;;;;;;AAGA;EAAA;;AAAA,OACE;EAAA,MAAQ,IAAI,CAAC,IAAb;EACA,QAAQ,MADR;EAEA,MAAQ,SAAC,CAAD;WAAO,IAAI,OAAO,CAAP;EAAX,CAFR;;;AAKF,OAAO;AACL;EADM,uBAAQ;SACd,MAAM,MAAN,EAAc,OAAd;AADK","file":"./bundle-hidden-source-map.js","sourcesContent":["# Taken from http://coffeescript.org/\r\n\r\n# Objects:\r\nmath =\r\n root: Math.sqrt\r\n square: square\r\n cube: (x) -> x * square x\r\n\r\n# Splats:\r\nrace = (winner, runners...) ->\r\n print winner, runners\r\n\n\n\n// WEBPACK FOOTER //\n// ./example.coffee"],"sourceRoot":""}
{"version":3,"sources":["webpack:///./example.coffee"],"names":[],"mappings":";;;;;;;;AAGA;EAAA;;AAAA,OACE;EAAA,MAAQ,IAAI,CAAC,IAAb;EACA,QAAQ,MADR;EAEA,MAAQ,SAAC,CAAD;WAAO,IAAI,OAAO,CAAP;EAAX,CAFR;;;AAKF,OAAO;AACL;EADM,uBAAQ;SACd,MAAM,MAAN,EAAc,OAAd;AADK","file":"./bundle-hidden-source-map.js","sourcesContent":["# Taken from http://coffeescript.org/\r\n\r\n# Objects:\r\nmath =\r\n root: Math.sqrt\r\n square: square\r\n cube: (x) -> x * square x\r\n\r\n# Splats:\r\nrace = (winner, runners...) ->\r\n print winner, runners\r\n"],"sourceRoot":""}
```
## inline-source-map.js
@ -153,7 +153,7 @@ race = function() {
/***/ })
],[[0,1]]]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9leGFtcGxlLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUdBO0VBQUE7O0FBQUEsT0FDRTtFQUFBLE1BQVEsSUFBSSxDQUFDLElBQWI7RUFDQSxRQUFRLE1BRFI7RUFFQSxNQUFRLFNBQUMsQ0FBRDtXQUFPLElBQUksT0FBTyxDQUFQO0VBQVgsQ0FGUjs7O0FBS0YsT0FBTztBQUNMO0VBRE0sdUJBQVE7U0FDZCxNQUFNLE1BQU4sRUFBYyxPQUFkO0FBREsiLCJmaWxlIjoiLi9idW5kbGUtaW5saW5lLXNvdXJjZS1tYXAuanMiLCJzb3VyY2VzQ29udGVudCI6WyIjIFRha2VuIGZyb20gaHR0cDovL2NvZmZlZXNjcmlwdC5vcmcvXHJcblxyXG4jIE9iamVjdHM6XHJcbm1hdGggPVxyXG4gIHJvb3Q6ICAgTWF0aC5zcXJ0XHJcbiAgc3F1YXJlOiBzcXVhcmVcclxuICBjdWJlOiAgICh4KSAtPiB4ICogc3F1YXJlIHhcclxuXHJcbiMgU3BsYXRzOlxyXG5yYWNlID0gKHdpbm5lciwgcnVubmVycy4uLikgLT5cclxuICBwcmludCB3aW5uZXIsIHJ1bm5lcnNcclxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vZXhhbXBsZS5jb2ZmZWUiXSwic291cmNlUm9vdCI6IiJ9
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9leGFtcGxlLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUdBO0VBQUE7O0FBQUEsT0FDRTtFQUFBLE1BQVEsSUFBSSxDQUFDLElBQWI7RUFDQSxRQUFRLE1BRFI7RUFFQSxNQUFRLFNBQUMsQ0FBRDtXQUFPLElBQUksT0FBTyxDQUFQO0VBQVgsQ0FGUjs7O0FBS0YsT0FBTztBQUNMO0VBRE0sdUJBQVE7U0FDZCxNQUFNLE1BQU4sRUFBYyxPQUFkO0FBREsiLCJmaWxlIjoiLi9idW5kbGUtaW5saW5lLXNvdXJjZS1tYXAuanMiLCJzb3VyY2VzQ29udGVudCI6WyIjIFRha2VuIGZyb20gaHR0cDovL2NvZmZlZXNjcmlwdC5vcmcvXHJcblxyXG4jIE9iamVjdHM6XHJcbm1hdGggPVxyXG4gIHJvb3Q6ICAgTWF0aC5zcXJ0XHJcbiAgc3F1YXJlOiBzcXVhcmVcclxuICBjdWJlOiAgICh4KSAtPiB4ICogc3F1YXJlIHhcclxuXHJcbiMgU3BsYXRzOlxyXG5yYWNlID0gKHdpbm5lciwgcnVubmVycy4uLikgLT5cclxuICBwcmludCB3aW5uZXIsIHJ1bm5lcnNcclxuIl0sInNvdXJjZVJvb3QiOiIifQ==
```
## nosources-source-map.js.map
@ -171,7 +171,7 @@ race = function() {
/*! no static exports found */
/***/ (function(module, exports) {
eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9leGFtcGxlLmNvZmZlZT85MWU1Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBO0VBQUE7O0FBQUEsT0FDRTtFQUFBLE1BQVEsSUFBSSxDQUFDLElBQWI7RUFDQSxRQUFRLE1BRFI7RUFFQSxNQUFRLFNBQUMsQ0FBRDtXQUFPLElBQUksT0FBTyxDQUFQO0VBQVgsQ0FGUjs7O0FBS0YsT0FBTztBQUNMO0VBRE0sdUJBQVE7U0FDZCxNQUFNLE1BQU4sRUFBYyxPQUFkO0FBREsiLCJmaWxlIjoiMC5qcyIsInNvdXJjZXNDb250ZW50IjpbIiMgVGFrZW4gZnJvbSBodHRwOi8vY29mZmVlc2NyaXB0Lm9yZy9cclxuXHJcbiMgT2JqZWN0czpcclxubWF0aCA9XHJcbiAgcm9vdDogICBNYXRoLnNxcnRcclxuICBzcXVhcmU6IHNxdWFyZVxyXG4gIGN1YmU6ICAgKHgpIC0+IHggKiBzcXVhcmUgeFxyXG5cclxuIyBTcGxhdHM6XHJcbnJhY2UgPSAod2lubmVyLCBydW5uZXJzLi4uKSAtPlxyXG4gIHByaW50IHdpbm5lciwgcnVubmVyc1xyXG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9leGFtcGxlLmNvZmZlZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///0\n");
eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9leGFtcGxlLmNvZmZlZT85MWU1Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBO0VBQUE7O0FBQUEsT0FDRTtFQUFBLE1BQVEsSUFBSSxDQUFDLElBQWI7RUFDQSxRQUFRLE1BRFI7RUFFQSxNQUFRLFNBQUMsQ0FBRDtXQUFPLElBQUksT0FBTyxDQUFQO0VBQVgsQ0FGUjs7O0FBS0YsT0FBTztBQUNMO0VBRE0sdUJBQVE7U0FDZCxNQUFNLE1BQU4sRUFBYyxPQUFkO0FBREsiLCJmaWxlIjoiMC5qcyIsInNvdXJjZXNDb250ZW50IjpbIiMgVGFrZW4gZnJvbSBodHRwOi8vY29mZmVlc2NyaXB0Lm9yZy9cclxuXHJcbiMgT2JqZWN0czpcclxubWF0aCA9XHJcbiAgcm9vdDogICBNYXRoLnNxcnRcclxuICBzcXVhcmU6IHNxdWFyZVxyXG4gIGN1YmU6ICAgKHgpIC0+IHggKiBzcXVhcmUgeFxyXG5cclxuIyBTcGxhdHM6XHJcbnJhY2UgPSAod2lubmVyLCBydW5uZXJzLi4uKSAtPlxyXG4gIHByaW50IHdpbm5lciwgcnVubmVyc1xyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n");
/***/ })
],[[0,1]]]);
@ -187,7 +187,7 @@ eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n sq
/*! no static exports found */
/***/ (function(module, exports) {
eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/node_modules/coffee-loader!./example.coffee\n// module id = 0\n// module chunks = 0\n\n//# sourceURL=webpack:///./example.coffee?(webpack)/node_modules/coffee-loader");
eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n\n\n//# sourceURL=webpack:///./example.coffee?(webpack)/node_modules/coffee-loader");
/***/ })
],[[0,1]]]);
@ -203,7 +203,7 @@ eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n sq
/*! no static exports found */
/***/ (function(module, exports) {
eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2V4YW1wbGUuY29mZmVlPzA5MjciXSwic291cmNlc0NvbnRlbnQiOlsidmFyIG1hdGgsIHJhY2UsXG4gIHNsaWNlID0gW10uc2xpY2U7XG5cbm1hdGggPSB7XG4gIHJvb3Q6IE1hdGguc3FydCxcbiAgc3F1YXJlOiBzcXVhcmUsXG4gIGN1YmU6IGZ1bmN0aW9uKHgpIHtcbiAgICByZXR1cm4geCAqIHNxdWFyZSh4KTtcbiAgfVxufTtcblxucmFjZSA9IGZ1bmN0aW9uKCkge1xuICB2YXIgcnVubmVycywgd2lubmVyO1xuICB3aW5uZXIgPSBhcmd1bWVudHNbMF0sIHJ1bm5lcnMgPSAyIDw9IGFyZ3VtZW50cy5sZW5ndGggPyBzbGljZS5jYWxsKGFyZ3VtZW50cywgMSkgOiBbXTtcbiAgcmV0dXJuIHByaW50KHdpbm5lciwgcnVubmVycyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gKHdlYnBhY2spL25vZGVfbW9kdWxlcy9jb2ZmZWUtbG9hZGVyIS4vZXhhbXBsZS5jb2ZmZWVcbi8vIG1vZHVsZSBpZCA9IDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///0\n");
eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2V4YW1wbGUuY29mZmVlPzA5MjciXSwic291cmNlc0NvbnRlbnQiOlsidmFyIG1hdGgsIHJhY2UsXG4gIHNsaWNlID0gW10uc2xpY2U7XG5cbm1hdGggPSB7XG4gIHJvb3Q6IE1hdGguc3FydCxcbiAgc3F1YXJlOiBzcXVhcmUsXG4gIGN1YmU6IGZ1bmN0aW9uKHgpIHtcbiAgICByZXR1cm4geCAqIHNxdWFyZSh4KTtcbiAgfVxufTtcblxucmFjZSA9IGZ1bmN0aW9uKCkge1xuICB2YXIgcnVubmVycywgd2lubmVyO1xuICB3aW5uZXIgPSBhcmd1bWVudHNbMF0sIHJ1bm5lcnMgPSAyIDw9IGFyZ3VtZW50cy5sZW5ndGggPyBzbGljZS5jYWxsKGFyZ3VtZW50cywgMSkgOiBbXTtcbiAgcmV0dXJuIHByaW50KHdpbm5lciwgcnVubmVycyk7XG59O1xuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///0\n");
/***/ })
],[[0,1]]]);
@ -219,7 +219,7 @@ eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n sq
/*! no static exports found */
/***/ (function(module, exports) {
eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2V4YW1wbGUuY29mZmVlPzkxZTUiXSwic291cmNlc0NvbnRlbnQiOlsiIyBUYWtlbiBmcm9tIGh0dHA6Ly9jb2ZmZWVzY3JpcHQub3JnL1xyXG5cclxuIyBPYmplY3RzOlxyXG5tYXRoID1cclxuICByb290OiAgIE1hdGguc3FydFxyXG4gIHNxdWFyZTogc3F1YXJlXHJcbiAgY3ViZTogICAoeCkgLT4geCAqIHNxdWFyZSB4XHJcblxyXG4jIFNwbGF0czpcclxucmFjZSA9ICh3aW5uZXIsIHJ1bm5lcnMuLi4pIC0+XHJcbiAgcHJpbnQgd2lubmVyLCBydW5uZXJzXHJcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL2V4YW1wbGUuY29mZmVlIl0sIm1hcHBpbmdzIjoiQUFHQTtBQUFBO0FBQ0E7QUFEQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQUE7OztBQUdBO0FBQ0E7QUFEQTtBQUNBO0FBREE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n");
eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2V4YW1wbGUuY29mZmVlPzkxZTUiXSwic291cmNlc0NvbnRlbnQiOlsiIyBUYWtlbiBmcm9tIGh0dHA6Ly9jb2ZmZWVzY3JpcHQub3JnL1xyXG5cclxuIyBPYmplY3RzOlxyXG5tYXRoID1cclxuICByb290OiAgIE1hdGguc3FydFxyXG4gIHNxdWFyZTogc3F1YXJlXHJcbiAgY3ViZTogICAoeCkgLT4geCAqIHNxdWFyZSB4XHJcblxyXG4jIFNwbGF0czpcclxucmFjZSA9ICh3aW5uZXIsIHJ1bm5lcnMuLi4pIC0+XHJcbiAgcHJpbnQgd2lubmVyLCBydW5uZXJzXHJcbiJdLCJtYXBwaW5ncyI6IkFBR0E7QUFBQTtBQUNBO0FBREE7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBOzs7QUFHQTtBQUNBO0FBREE7QUFDQTtBQURBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n");
/***/ })
],[[0,1]]]);
@ -227,147 +227,147 @@ eval("var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n sq
## cheap-module-source-map.js.map
``` javascript
{"version":3,"file":"./bundle-cheap-module-source-map.js","sources":["webpack:///./example.coffee"],"sourcesContent":["# Taken from http://coffeescript.org/\r\n\r\n# Objects:\r\nmath =\r\n root: Math.sqrt\r\n square: square\r\n cube: (x) -> x * square x\r\n\r\n# Splats:\r\nrace = (winner, runners...) ->\r\n print winner, runners\r\n\n\n\n// WEBPACK FOOTER //\n// ./example.coffee"],"mappings":";;;;;;;;AAGA;AAAA;AACA;AADA;AACA;AACA;AACA;AAAA;AAAA;;;AAGA;AACA;AADA;AACA;AADA;;;;A","sourceRoot":""}
{"version":3,"file":"./bundle-cheap-module-source-map.js","sources":["webpack:///./example.coffee"],"sourcesContent":["# Taken from http://coffeescript.org/\r\n\r\n# Objects:\r\nmath =\r\n root: Math.sqrt\r\n square: square\r\n cube: (x) -> x * square x\r\n\r\n# Splats:\r\nrace = (winner, runners...) ->\r\n print winner, runners\r\n"],"mappings":";;;;;;;;AAGA;AAAA;AACA;AADA;AACA;AACA;AACA;AAAA;AAAA;;;AAGA;AACA;AADA;AACA;AADA;;;;A","sourceRoot":""}
```
## cheap-source-map.js.map
``` javascript
{"version":3,"file":"./bundle-cheap-source-map.js","sources":["webpack:///./example.coffee"],"sourcesContent":["var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/node_modules/coffee-loader!./example.coffee\n// module id = 0\n// module chunks = 0"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}
{"version":3,"file":"./bundle-cheap-source-map.js","sources":["webpack:///./example.coffee"],"sourcesContent":["var math, race,\n slice = [].slice;\n\nmath = {\n root: Math.sqrt,\n square: square,\n cube: function(x) {\n return x * square(x);\n }\n};\n\nrace = function() {\n var runners, winner;\n winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n return print(winner, runners);\n};\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}
```
# webpack output
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-cheap-eval-source-map.js 1.68 KiB 0 [emitted] bundle
./bundle-runtime-cheap-eval-source-map.js 4.93 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-cheap-eval-source-map.js ./bundle-cheap-eval-source-map.js
./bundle-cheap-eval-source-map.js 1.5 KiB 0 [emitted] bundle
./runtime~bundle-cheap-eval-source-map.js 4.93 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-cheap-eval-source-map.js ./bundle-cheap-eval-source-map.js
chunk {0} ./bundle-cheap-eval-source-map.js (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-cheap-eval-source-map.js (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-cheap-eval-source-map.js (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-cheap-module-eval-source-map.js 1.42 KiB 0 [emitted] bundle
./bundle-runtime-cheap-module-eval-source-map.js 4.93 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-cheap-module-eval-source-map.js ./bundle-cheap-module-eval-source-map.js
./bundle-cheap-module-eval-source-map.js 1.36 KiB 0 [emitted] bundle
./runtime~bundle-cheap-module-eval-source-map.js 4.93 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-cheap-module-eval-source-map.js ./bundle-cheap-module-eval-source-map.js
chunk {0} ./bundle-cheap-module-eval-source-map.js (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-cheap-module-eval-source-map.js (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-cheap-module-eval-source-map.js (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-cheap-module-source-map.js 733 bytes 0 [emitted] bundle
./bundle-runtime-cheap-module-source-map.js 5 KiB 1 [emitted] bundle-runtime
./bundle-cheap-module-source-map.js.map 506 bytes 0 [emitted] bundle
./bundle-runtime-cheap-module-source-map.js.map 4.96 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-cheap-module-source-map.js ./bundle-runtime-cheap-module-source-map.js.map ./bundle-cheap-module-source-map.js ./bundle-cheap-module-source-map.js.map
./runtime~bundle-cheap-module-source-map.js 5 KiB 1 [emitted] runtime~bundle
./bundle-cheap-module-source-map.js.map 459 bytes 0 [emitted] bundle
./runtime~bundle-cheap-module-source-map.js.map 4.92 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-cheap-module-source-map.js ./runtime~bundle-cheap-module-source-map.js.map ./bundle-cheap-module-source-map.js ./bundle-cheap-module-source-map.js.map
chunk {0} ./bundle-cheap-module-source-map.js, ./bundle-cheap-module-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-cheap-module-source-map.js, ./bundle-runtime-cheap-module-source-map.js.map (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-cheap-module-source-map.js, ./runtime~bundle-cheap-module-source-map.js.map (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-cheap-source-map.js 726 bytes 0 [emitted] bundle
./bundle-runtime-cheap-source-map.js 4.99 KiB 1 [emitted] bundle-runtime
./bundle-cheap-source-map.js.map 702 bytes 0 [emitted] bundle
./bundle-runtime-cheap-source-map.js.map 4.96 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-cheap-source-map.js ./bundle-runtime-cheap-source-map.js.map ./bundle-cheap-source-map.js ./bundle-cheap-source-map.js.map
./runtime~bundle-cheap-source-map.js 4.99 KiB 1 [emitted] runtime~bundle
./bundle-cheap-source-map.js.map 561 bytes 0 [emitted] bundle
./runtime~bundle-cheap-source-map.js.map 4.91 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-cheap-source-map.js ./runtime~bundle-cheap-source-map.js.map ./bundle-cheap-source-map.js ./bundle-cheap-source-map.js.map
chunk {0} ./bundle-cheap-source-map.js, ./bundle-cheap-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-cheap-source-map.js, ./bundle-runtime-cheap-source-map.js.map (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-cheap-source-map.js, ./runtime~bundle-cheap-source-map.js.map (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-eval.js 920 bytes 0 [emitted] bundle
./bundle-runtime-eval.js 4.93 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-eval.js ./bundle-eval.js
./bundle-eval.js 781 bytes 0 [emitted] bundle
./runtime~bundle-eval.js 4.93 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-eval.js ./bundle-eval.js
chunk {0} ./bundle-eval.js (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-eval.js (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-eval.js (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-eval-source-map.js 1.56 KiB 0 [emitted] bundle
./bundle-runtime-eval-source-map.js 4.93 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-eval-source-map.js ./bundle-eval-source-map.js
./bundle-eval-source-map.js 1.49 KiB 0 [emitted] bundle
./runtime~bundle-eval-source-map.js 4.93 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-eval-source-map.js ./bundle-eval-source-map.js
chunk {0} ./bundle-eval-source-map.js (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-eval-source-map.js (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-eval-source-map.js (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-hidden-source-map.js 674 bytes 0 [emitted] bundle
./bundle-runtime-hidden-source-map.js 4.93 KiB 1 [emitted] bundle-runtime
./bundle-hidden-source-map.js.map 603 bytes 0 [emitted] bundle
./bundle-runtime-hidden-source-map.js.map 5 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-hidden-source-map.js ./bundle-runtime-hidden-source-map.js.map ./bundle-hidden-source-map.js ./bundle-hidden-source-map.js.map
./runtime~bundle-hidden-source-map.js 4.93 KiB 1 [emitted] runtime~bundle
./bundle-hidden-source-map.js.map 556 bytes 0 [emitted] bundle
./runtime~bundle-hidden-source-map.js.map 4.96 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-hidden-source-map.js ./runtime~bundle-hidden-source-map.js.map ./bundle-hidden-source-map.js ./bundle-hidden-source-map.js.map
chunk {0} ./bundle-hidden-source-map.js, ./bundle-hidden-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-hidden-source-map.js, ./bundle-runtime-hidden-source-map.js.map (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-hidden-source-map.js, ./runtime~bundle-hidden-source-map.js.map (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-inline-source-map.js 1.51 KiB 0 [emitted] bundle
./bundle-runtime-inline-source-map.js 11.7 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-inline-source-map.js ./bundle-inline-source-map.js
./bundle-inline-source-map.js 1.45 KiB 0 [emitted] bundle
./runtime~bundle-inline-source-map.js 11.6 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-inline-source-map.js ./bundle-inline-source-map.js
chunk {0} ./bundle-inline-source-map.js (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-inline-source-map.js (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-inline-source-map.js (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-nosources-source-map.js 730 bytes 0 [emitted] bundle
./bundle-runtime-nosources-source-map.js 5 KiB 1 [emitted] bundle-runtime
./runtime~bundle-nosources-source-map.js 5 KiB 1 [emitted] runtime~bundle
./bundle-nosources-source-map.js.map 314 bytes 0 [emitted] bundle
./bundle-runtime-nosources-source-map.js.map 838 bytes 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-nosources-source-map.js ./bundle-runtime-nosources-source-map.js.map ./bundle-nosources-source-map.js ./bundle-nosources-source-map.js.map
./runtime~bundle-nosources-source-map.js.map 838 bytes 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-nosources-source-map.js ./runtime~bundle-nosources-source-map.js.map ./bundle-nosources-source-map.js ./bundle-nosources-source-map.js.map
chunk {0} ./bundle-nosources-source-map.js, ./bundle-nosources-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-nosources-source-map.js, ./bundle-runtime-nosources-source-map.js.map (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-nosources-source-map.js, ./runtime~bundle-nosources-source-map.js.map (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
Child
Hash: 0a1b2c3d4e5f6a7b8c9d
Asset Size Chunks Chunk Names
./bundle-source-map.js 720 bytes 0 [emitted] bundle
./bundle-runtime-source-map.js 4.99 KiB 1 [emitted] bundle-runtime
./bundle-source-map.js.map 596 bytes 0 [emitted] bundle
./bundle-runtime-source-map.js.map 5 KiB 1 [emitted] bundle-runtime
Entrypoint bundle = ./bundle-runtime-source-map.js ./bundle-runtime-source-map.js.map ./bundle-source-map.js ./bundle-source-map.js.map
./runtime~bundle-source-map.js 4.99 KiB 1 [emitted] runtime~bundle
./bundle-source-map.js.map 549 bytes 0 [emitted] bundle
./runtime~bundle-source-map.js.map 4.95 KiB 1 [emitted] runtime~bundle
Entrypoint bundle = ./runtime~bundle-source-map.js ./runtime~bundle-source-map.js.map ./bundle-source-map.js ./bundle-source-map.js.map
chunk {0} ./bundle-source-map.js, ./bundle-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered]
> coffee-loader!./example.coffee bundle
[0] (webpack)/node_modules/coffee-loader!./example.coffee 308 bytes {0} [built]
single entry coffee-loader!./example.coffee bundle
chunk {1} ./bundle-runtime-source-map.js, ./bundle-runtime-source-map.js.map (bundle-runtime) 0 bytes ={0}= [entry] [rendered]
chunk {1} ./runtime~bundle-source-map.js, ./runtime~bundle-source-map.js.map (runtime~bundle) 0 bytes ={0}= [entry] [rendered]
> coffee-loader!./example.coffee bundle
```

View File

@ -15,6 +15,7 @@ function lessStrict(regExpStr) {
const runtimeRegexp = /(```\s*(?:js|javascript)\n)?(.*)(\/\*\*\*\*\*\*\/ \(function\(modules\) \{ \/\/ webpackBootstrap\n(?:.|\n)*?\n\/\*\*\*\*\*\*\/ \}\)\n\/\**\/\n)/;
const timeRegexp = /\s*Time: \d+ms/g;
const buildAtRegexp = /\s*Built at: .+/mg;
const hashRegexp = /Hash: [a-f0-9]+/g;
exports.replaceBase = (template) => {
@ -36,6 +37,7 @@ exports.replaceBase = (template) => {
.replace(webpack, "(webpack)")
.replace(webpackParent, "(webpack)/~")
.replace(timeRegexp, "")
.replace(buildAtRegexp, "")
.replace(hashRegexp, "Hash: 0a1b2c3d4e5f6a7b8c9d")
.replace(/\.chunkhash\./g, ".[chunkhash].")
.replace(runtimeRegexp, function(match) {

View File

@ -373,7 +373,7 @@ __webpack_require__(/*! ./vendor2 */ 3);
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
vendor1.js 2.99 KiB 0 [emitted] vendor1
vendor2.js 3.25 KiB 1 [emitted] vendor2
@ -429,7 +429,7 @@ chunk {4} pageC.js (pageC) 25 bytes [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
pageC.js 569 bytes 0 [emitted] pageC
pageB.js 569 bytes 1 [emitted] pageB

View File

@ -316,11 +316,11 @@ function timed(name, fn) {
"use strict";
// Instanciate WebAssembly module
// Instantiate WebAssembly module
var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], {
});
// export exports from WebAssmbly module
// export exports from WebAssembly module
module.exports = instance.exports;
/***/ }),
@ -371,11 +371,11 @@ function fibonacciJavascript(i) {
"use strict";
// Instanciate WebAssembly module
// Instantiate WebAssembly module
var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], {
});
// export exports from WebAssmbly module
// export exports from WebAssembly module
module.exports = instance.exports;
/***/ }),
@ -388,11 +388,11 @@ module.exports = instance.exports;
"use strict";
// Instanciate WebAssembly module
// Instantiate WebAssembly module
var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], {
});
// export exports from WebAssmbly module
// export exports from WebAssembly module
module.exports = instance.exports;
/***/ })
@ -413,11 +413,11 @@ module.exports = instance.exports;
"use strict";
// Instanciate WebAssembly module
// Instantiate WebAssembly module
var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], {
});
// export exports from WebAssmbly module
// export exports from WebAssembly module
module.exports = instance.exports;
/***/ })
@ -430,13 +430,13 @@ module.exports = instance.exports;
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 2.88 KiB 0 [emitted]
9c8c5b45b5c12888e105.wasm 41 bytes 0, 1 [emitted]
62df68d96f4aa17e7b77.wasm 67 bytes 0 [emitted]
e5003c8310987c008228.wasm 62 bytes 0 [emitted]
1.output.js 461 bytes 1 [emitted]
1.output.js 462 bytes 1 [emitted]
output.js 8.91 KiB 2 [emitted] main
Entrypoint main = output.js
chunk {0} 0.output.js, 9c8c5b45b5c12888e105.wasm, 62df68d96f4aa17e7b77.wasm, e5003c8310987c008228.wasm 585 bytes <{2}> [rendered]
@ -474,7 +474,7 @@ chunk {2} output.js (main) 788 bytes >{0}< >{1}< [entry] [rendered]
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.output.js 722 bytes 0, 1 [emitted]
fb3978ee17c3b5162f77.wasm 41 bytes 0, 1, 1 [emitted]

View File

@ -343,17 +343,17 @@ module.exports = function() {
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.hash.worker.js 1.82 KiB [emitted]
hash.worker.js 4.02 KiB [emitted]
output.js 3.46 KiB 0 [emitted] main
Entrypoint main = output.js
chunk {0} output.js (main) 326 bytes [entry] [rendered]
chunk {0} output.js (main) 332 bytes [entry] [rendered]
> .\example.js main
[0] (webpack)/node_modules/worker-loader/dist/cjs.js?name=hash.worker.js!./worker.js 97 bytes {0} [not cacheable] [built]
cjs require worker-loader?name=hash.worker.js!./worker [1] ./example.js 1:13-66
[1] ./example.js 229 bytes {0} [built]
[1] ./example.js 235 bytes {0} [built]
single entry .\example.js main
Child worker:
Asset Size Chunks Chunk Names
@ -383,17 +383,17 @@ Child worker:
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack next
Version: webpack 4.0.0-beta.2
Asset Size Chunks Chunk Names
0.hash.worker.js 594 bytes [emitted]
hash.worker.js 919 bytes [emitted]
output.js 697 bytes 0 [emitted] main
Entrypoint main = output.js
chunk {0} output.js (main) 326 bytes [entry] [rendered]
chunk {0} output.js (main) 332 bytes [entry] [rendered]
> .\example.js main
[0] (webpack)/node_modules/worker-loader/dist/cjs.js?name=hash.worker.js!./worker.js 97 bytes {0} [not cacheable] [built]
cjs require worker-loader?name=hash.worker.js!./worker [1] ./example.js 1:13-66
[1] ./example.js 229 bytes {0} [built]
[1] ./example.js 235 bytes {0} [built]
single entry .\example.js main
Child worker:
Asset Size Chunks Chunk Names

View File

@ -4,7 +4,7 @@
*/
"use strict";
const asyncLib = require("async");
const asyncLib = require("neo-async");
const PrefetchDependency = require("./dependencies/PrefetchDependency");
const NormalModule = require("./NormalModule");

View File

@ -4,12 +4,12 @@
*/
"use strict";
const asyncLib = require("async");
const asyncLib = require("neo-async");
class CachePlugin {
constructor(cache) {
this.cache = cache || {};
this.FS_ACCURENCY = 2000;
this.FS_ACCURACY = 2000;
}
apply(compiler) {
@ -19,7 +19,7 @@ class CachePlugin {
});
} else {
const registerCacheToCompiler = (compiler, cache) => {
compiler.hooks.thisCompilation.tap("CachePlugin", (compilation) => {
compiler.hooks.thisCompilation.tap("CachePlugin", compilation => {
compilation.cache = cache;
compilation.hooks.childCompiler.tap("CachePlugin", (childCompiler, compilerName, compilerIndex) => {
if(cache) {
@ -61,13 +61,13 @@ class CachePlugin {
if(err) return callback(err);
for(const [file, ts] of fileTs) {
fileTs.set(file, ts + this.FS_ACCURENCY);
fileTs.set(file, ts + this.FS_ACCURACY);
}
callback();
});
});
compiler.hooks.afterCompile.tap("CachePlugin", (compilation) => {
compiler.hooks.afterCompile.tap("CachePlugin", compilation => {
compilation.compiler._lastCompilationFileDependencies = compilation.fileDependencies;
compilation.compiler._lastCompilationContextDependencies = compilation.contextDependencies;
});
@ -76,14 +76,14 @@ class CachePlugin {
/* istanbul ignore next */
applyMtime(mtime) {
if(this.FS_ACCURENCY > 1 && mtime % 2 !== 0)
this.FS_ACCURENCY = 1;
else if(this.FS_ACCURENCY > 10 && mtime % 20 !== 0)
this.FS_ACCURENCY = 10;
else if(this.FS_ACCURENCY > 100 && mtime % 200 !== 0)
this.FS_ACCURENCY = 100;
else if(this.FS_ACCURENCY > 1000 && mtime % 2000 !== 0)
this.FS_ACCURENCY = 1000;
if(this.FS_ACCURACY > 1 && mtime % 2 !== 0)
this.FS_ACCURACY = 1;
else if(this.FS_ACCURACY > 10 && mtime % 20 !== 0)
this.FS_ACCURACY = 10;
else if(this.FS_ACCURACY > 100 && mtime % 200 !== 0)
this.FS_ACCURACY = 100;
else if(this.FS_ACCURACY > 1000 && mtime % 2000 !== 0)
this.FS_ACCURACY = 1000;
}
}
module.exports = CachePlugin;

View File

@ -13,9 +13,11 @@ module.exports = class CaseSensitiveModulesWarning extends WebpackError {
this.name = "CaseSensitiveModulesWarning";
const sortedModules = this._sort(modules);
const modulesList = this._moduleMessages(sortedModules);
this.message = "There are multiple modules with names that only differ in casing.\n" +
"This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.\n" +
`Use equal casing. Compare these module identifiers:\n${modulesList}`;
this.message = `There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
${modulesList}`;
this.origin = this.module = sortedModules[0];
Error.captureStackTrace(this, this.constructor);

View File

@ -8,6 +8,8 @@ const util = require("util");
const SortableSet = require("./util/SortableSet");
const GraphHelpers = require("./GraphHelpers");
let debugId = 1000;
const ERR_CHUNK_ENTRY = "Chunk.entry was removed. Use hasRuntime()";
const ERR_CHUNK_INITIAL = "Chunk.initial was removed. Use canBeInitial/isOnlyInitial()";
const sortById = (a, b) => {
if(a.id < b.id) return -1;
@ -59,19 +61,19 @@ class Chunk {
}
get entry() {
throw new Error("Chunk.entry was removed. Use hasRuntime()");
throw new Error(ERR_CHUNK_ENTRY);
}
set entry(data) {
throw new Error("Chunk.entry was removed. Use hasRuntime()");
throw new Error(ERR_CHUNK_ENTRY);
}
get initial() {
throw new Error("Chunk.initial was removed. Use canBeInitial/isOnlyInitial()");
throw new Error(ERR_CHUNK_INITIAL);
}
set initial(data) {
throw new Error("Chunk.initial was removed. Use canBeInitial/isOnlyInitial()");
throw new Error(ERR_CHUNK_INITIAL);
}
hasRuntime() {

View File

@ -4,7 +4,7 @@
*/
"use strict";
const asyncLib = require("async");
const asyncLib = require("neo-async");
const util = require("util");
const Tapable = require("tapable").Tapable;
const SyncHook = require("tapable").SyncHook;
@ -1007,45 +1007,44 @@ class Compilation extends Tapable {
}
assignDepth(module) {
const assignDepthToModule = (module, depth) => {
// enter module
if(typeof module.depth === "number" && module.depth <= depth) return;
module.depth = depth;
const queue = new Set([module]);
let depth;
// enter it as block
assignDepthToDependencyBlock(module, depth + 1);
module.depth = 0;
const enqueueJob = module => {
const d = module.depth;
if(typeof d === "number" && d <= depth) return;
queue.add(module);
module.depth = depth;
};
const assignDepthToDependency = (dependency, depth) => {
if(dependency.module) {
queue.push(() => assignDepthToModule(dependency.module, depth));
enqueueJob(dependency.module);
}
};
const assignDepthToDependencyBlock = (block, depth) => {
const iteratorDependency = d => assignDepthToDependency(d, depth);
const iteratorBlock = b => assignDepthToDependencyBlock(b, depth);
const assignDepthToDependencyBlock = block => {
if(block.variables) {
iterationBlockVariable(block.variables, iteratorDependency);
iterationBlockVariable(block.variables, assignDepthToDependency);
}
if(block.dependencies) {
iterationOfArrayCallback(block.dependencies, iteratorDependency);
iterationOfArrayCallback(block.dependencies, assignDepthToDependency);
}
if(block.blocks) {
iterationOfArrayCallback(block.blocks, iteratorBlock);
iterationOfArrayCallback(block.blocks, assignDepthToDependencyBlock);
}
};
const queue = [() => {
assignDepthToModule(module, 0);
}];
for(module of queue) {
queue.delete(module);
depth = module.depth;
while(queue.length) {
queue.pop()();
depth++;
assignDepthToDependencyBlock(module);
}
}

View File

@ -4,7 +4,7 @@
*/
"use strict";
const asyncLib = require("async");
const asyncLib = require("neo-async");
const path = require("path");
const util = require("util");
const Tapable = require("tapable").Tapable;
@ -28,7 +28,7 @@ class Compiler extends Tapable {
super();
this.hooks = {
shouldEmit: new SyncBailHook(["compilation"]),
done: new SyncHook(["stats"]),
done: new AsyncSeriesHook(["stats"]),
additionalPass: new AsyncSeriesHook([]),
beforeRun: new AsyncSeriesHook(["compilation"]),
run: new AsyncSeriesHook(["compilation"]),
@ -171,8 +171,11 @@ class Compiler extends Tapable {
const stats = new Stats(compilation);
stats.startTime = startTime;
stats.endTime = Date.now();
this.hooks.done.call(stats);
return callback(null, stats);
this.hooks.done.callAsync(stats, err => {
if(err) return callback(err);
return callback(null, stats);
});
return;
}
this.emitAssets(compilation, err => {
@ -184,11 +187,13 @@ class Compiler extends Tapable {
const stats = new Stats(compilation);
stats.startTime = startTime;
stats.endTime = Date.now();
this.hooks.done.call(stats);
this.hooks.additionalPass.callAsync(err => {
this.hooks.done.callAsync(stats, err => {
if(err) return callback(err);
this.compile(onCompiled);
this.hooks.additionalPass.callAsync(err => {
if(err) return callback(err);
this.compile(onCompiled);
});
});
return;
}
@ -199,8 +204,10 @@ class Compiler extends Tapable {
const stats = new Stats(compilation);
stats.startTime = startTime;
stats.endTime = Date.now();
this.hooks.done.call(stats);
return callback(null, stats);
this.hooks.done.callAsync(stats, err => {
if(err) return callback(err);
return callback(null, stats);
});
});
});
};
@ -248,7 +255,7 @@ class Compiler extends Tapable {
const emitFiles = (err) => {
if(err) return callback(err);
asyncLib.forEach(Object.keys(compilation.assets), (file, callback) => {
asyncLib.forEach(compilation.assets, (source, file, callback) => {
let targetFile = file;
const queryStringIdx = targetFile.indexOf("?");
@ -259,7 +266,6 @@ class Compiler extends Tapable {
const writeOut = (err) => {
if(err) return callback(err);
const targetPath = this.outputFileSystem.join(outputPath, targetFile);
const source = compilation.assets[file];
if(source.existsAt === targetPath) {
source.emitted = false;
return callback();

View File

@ -9,7 +9,7 @@ const ParserHelpers = require("./ParserHelpers");
const getQuery = (request) => {
const i = request.indexOf("?");
return request.includes("?") ? request.substr(i) : "";
return i !== -1 ? request.substr(i) : "";
};
const collectDeclaration = (declarations, pattern) => {

View File

@ -17,11 +17,8 @@ class ContextModule extends Module {
// resolveDependencies: (fs: FS, options: ContextOptions, (err: Error?, dependencies: Dependency[]) => void) => void
// options: ContextOptions
constructor(resolveDependencies, options) {
super("javascript/dynamic");
// Info from Factory
this.resolveDependencies = resolveDependencies;
let resource, resourceQuery;
let resource;
let resourceQuery;
const queryIdx = options.resource.indexOf("?");
if(queryIdx >= 0) {
resource = options.resource.substr(0, queryIdx);
@ -30,11 +27,15 @@ class ContextModule extends Module {
resource = options.resource;
resourceQuery = "";
}
super("javascript/dynamic", resource);
// Info from Factory
this.resolveDependencies = resolveDependencies;
this.options = Object.assign({}, options, {
resource: resource,
resourceQuery: resourceQuery
});
this.context = this.options.resource;
if(options.resolveOptions !== undefined)
this.resolveOptions = options.resolveOptions;

View File

@ -4,7 +4,7 @@
*/
"use strict";
const asyncLib = require("async");
const asyncLib = require("neo-async");
const path = require("path");
const Tapable = require("tapable").Tapable;

View File

@ -13,7 +13,7 @@ const DelegatedExportsDependency = require("./dependencies/DelegatedExportsDepen
class DelegatedModule extends Module {
constructor(sourceRequest, data, type, userRequest, originalRequest) {
super("javascript/dynamic");
super("javascript/dynamic", null);
// Info from Factory
this.sourceRequest = sourceRequest;

View File

@ -9,10 +9,9 @@ const RawSource = require("webpack-sources").RawSource;
class DllModule extends Module {
constructor(context, dependencies, name, type) {
super("javascript/dynamic");
super("javascript/dynamic", context);
// Info from Factory
this.context = context;
this.dependencies = dependencies;
this.name = name;
this.type = type;

View File

@ -19,9 +19,9 @@ class Entrypoint extends ChunkGroup {
getFiles() {
const files = new Set();
for(let chunkIdx = 0; chunkIdx < this.chunks.length; chunkIdx++) {
for(let fileIdx = 0; fileIdx < this.chunks[chunkIdx].files.length; fileIdx++) {
files.add(this.chunks[chunkIdx].files[fileIdx]);
for(const chunk of this.chunks) {
for(const file of chunk.files) {
files.add(file);
}
}

View File

@ -7,6 +7,9 @@
const DefinePlugin = require("./DefinePlugin");
const needsEnvVarFix = ["8", "9"].indexOf(process.versions.node.split(".")[0]) >= 0 &&
process.platform === "win32";
class EnvironmentPlugin {
constructor(...keys) {
if(keys.length === 1 && Array.isArray(keys[0])) {
@ -23,6 +26,13 @@ class EnvironmentPlugin {
apply(compiler) {
const definitions = this.keys.reduce((defs, key) => {
// TODO remove once the fix has made its way into Node 8.
// Work around https://github.com/nodejs/node/pull/18463,
// affecting Node 8 & 9 by performing an OS-level
// operation that always succeeds before reading
// environment variables:
if(needsEnvVarFix) require("os").cpus();
const value = process.env[key] !== undefined ? process.env[key] : this.defaultValues[key];
if(value === undefined) {

View File

@ -24,10 +24,7 @@ class EvalDevToolModuleTemplatePlugin {
moduleFilenameTemplate: this.moduleFilenameTemplate,
namespace: this.namespace
}, moduleTemplate.runtimeTemplate.requestShortener);
const footer = ["\n",
ModuleFilenameHelpers.createFooter(module, moduleTemplate.runtimeTemplate.requestShortener),
this.sourceUrlComment.replace(/\[url\]/g, encodeURI(str).replace(/%2F/g, "/").replace(/%20/g, "_").replace(/%5E/g, "^").replace(/%5C/g, "\\").replace(/^\//, ""))
].join("\n");
const footer = "\n" + this.sourceUrlComment.replace(/\[url\]/g, encodeURI(str).replace(/%2F/g, "/").replace(/%20/g, "_").replace(/%5E/g, "^").replace(/%5C/g, "\\").replace(/^\//, ""));
const result = new RawSource(`eval(${JSON.stringify(content + footer)});`);
cache.set(source, result);
return result;

View File

@ -19,9 +19,14 @@ class EvalSourceMapDevToolModuleTemplatePlugin {
apply(moduleTemplate) {
const self = this;
const options = this.options;
const matchModule = ModuleFilenameHelpers.matchObject.bind(ModuleFilenameHelpers, options);
moduleTemplate.hooks.module.tap("EvalSourceMapDevToolModuleTemplatePlugin", (source, module) => {
if(source.__EvalSourceMapDevToolData)
return source.__EvalSourceMapDevToolData;
if(!matchModule(module.resource)) {
return source;
}
let sourceMap;
let content;
if(source.sourceAndMap) {
@ -57,11 +62,6 @@ class EvalSourceMapDevToolModuleTemplatePlugin {
return filename;
});
sourceMap.sources = moduleFilenames;
if(sourceMap.sourcesContent) {
sourceMap.sourcesContent = sourceMap.sourcesContent.map((content, i) => {
return typeof content === "string" ? `${content}\n\n\n${ModuleFilenameHelpers.createFooter(modules[i], moduleTemplate.runtimeTemplate.requestShortener)}` : null;
});
}
sourceMap.sourceRoot = options.sourceRoot || "";
sourceMap.file = `${module.id}.js`;

View File

@ -11,7 +11,7 @@ const Template = require("./Template");
class ExternalModule extends Module {
constructor(request, type, userRequest) {
super("javascript/dynamic");
super("javascript/dynamic", null);
// Info from Factory
this.request = request;

View File

@ -14,7 +14,7 @@ class HashedModuleIdsPlugin {
this.options = Object.assign({
context: null,
hashFunction: "md5",
hashFunction: "md4",
hashDigest: "base64",
hashDigestLength: 4
}, options);

View File

@ -203,7 +203,10 @@ module.exports = class HotModuleReplacementPlugin {
const handler = (parser, parserOptions) => {
parser.hooks.expression.for("__webpack_hash__").tap("HotModuleReplacementPlugin", ParserHelpers.toConstantDependencyWithWebpackRequire(parser, "__webpack_require__.h()"));
parser.hooks.evaluateTypeof.for("__webpack_hash__").tap("HotModuleReplacementPlugin", ParserHelpers.evaluateToString("string"));
parser.hooks.evaluateIdentifier.for("module.hot").tap("HotModuleReplacementPlugin", expr => {
parser.hooks.evaluateIdentifier.for("module.hot").tap({
name: "HotModuleReplacementPlugin",
before: "NodeStuffPlugin"
}, expr => {
return ParserHelpers.evaluateToIdentifier("module.hot", !!parser.state.compilation.hotUpdateChunkTemplate)(expr);
});
// TODO webpack 5: refactor this, no custom hooks

186
lib/JavascriptGenerator.js Normal file
View File

@ -0,0 +1,186 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const RawSource = require("webpack-sources").RawSource;
const ReplaceSource = require("webpack-sources").ReplaceSource;
// TODO: clean up this file
// replace with newer constructs
// TODO: remove DependencyVariables and replace them with something better
class JavascriptGenerator {
generate(module, dependencyTemplates, runtimeTemplate) {
const originalSource = module.originalSource();
if(!originalSource) {
return new RawSource("throw new Error('No source available');");
}
const source = new ReplaceSource(originalSource);
this.sourceBlock(module, module, [], dependencyTemplates, source, runtimeTemplate);
return source;
}
sourceBlock(module, block, availableVars, dependencyTemplates, source, runtimeTemplate) {
for(const dependency of block.dependencies) {
this.sourceDependency(dependency, dependencyTemplates, source, runtimeTemplate);
}
/**
* Get the variables of all blocks that we need to inject.
* These will contain the variable name and its expression.
* The name will be added as a paramter in a IIFE the expression as its value.
*/
const vars = block.variables.reduce((result, value) => {
const variable = this.sourceVariables(
value, availableVars, dependencyTemplates, runtimeTemplate);
if(variable) {
result.push(variable);
}
return result;
}, []);
/**
* if we actually have variables
* this is important as how #splitVariablesInUniqueNamedChunks works
* it will always return an array in an array which would lead to a IIFE wrapper around
* a module if we do this with an empty vars array.
*/
if(vars.length > 0) {
/**
* Split all variables up into chunks of unique names.
* e.g. imagine you have the following variable names that need to be injected:
* [foo, bar, baz, foo, some, more]
* we can not inject "foo" twice, therefore we just make two IIFEs like so:
* (function(foo, bar, baz){
* (function(foo, some, more){
* ...
* }(...));
* }(...));
*
* "splitVariablesInUniqueNamedChunks" splits the variables shown above up to this:
* [[foo, bar, baz], [foo, some, more]]
*/
const injectionVariableChunks = this.splitVariablesInUniqueNamedChunks(vars);
// create all the beginnings of IIFEs
const functionWrapperStarts = injectionVariableChunks.map((variableChunk) => {
return this.variableInjectionFunctionWrapperStartCode(
variableChunk.map(variable => variable.name)
);
});
// and all the ends
const functionWrapperEnds = injectionVariableChunks.map((variableChunk) => {
return this.variableInjectionFunctionWrapperEndCode(
module,
variableChunk.map(variable => variable.expression), block
);
});
// join them to one big string
const varStartCode = functionWrapperStarts.join("");
// reverse the ends first before joining them, as the last added must be the inner most
const varEndCode = functionWrapperEnds.reverse().join("");
// if we have anything, add it to the source
if(varStartCode && varEndCode) {
const start = block.range ? block.range[0] : -10;
const end = block.range ? block.range[1] : (module.originalSource().size() + 1);
source.insert(start + 0.5, varStartCode);
source.insert(end + 0.5, "\n/* WEBPACK VAR INJECTION */" + varEndCode);
}
}
for(const childBlock of block.blocks) {
this.sourceBlock(
module,
childBlock,
availableVars.concat(vars),
dependencyTemplates,
source,
runtimeTemplate
);
}
}
sourceDependency(dependency, dependencyTemplates, source, runtimeTemplate) {
const template = dependencyTemplates.get(dependency.constructor);
if(!template) throw new Error("No template for dependency: " + dependency.constructor.name);
template.apply(dependency, source, runtimeTemplate, dependencyTemplates);
}
sourceVariables(variable, availableVars, dependencyTemplates, runtimeTemplate) {
const name = variable.name;
const expr = variable.expressionSource(dependencyTemplates, runtimeTemplate);
if(availableVars.some(v => v.name === name && v.expression.source() === expr.source())) {
return;
}
return {
name: name,
expression: expr
};
}
/*
* creates the start part of a IIFE around the module to inject a variable name
* (function(...){ <- this part
* }.call(...))
*/
variableInjectionFunctionWrapperStartCode(varNames) {
const args = varNames.join(", ");
return `/* WEBPACK VAR INJECTION */(function(${args}) {`;
}
contextArgument(module, block) {
if(this === block) {
return module.exportsArgument;
}
return "this";
}
/*
* creates the end part of a IIFE around the module to inject a variable name
* (function(...){
* }.call(...)) <- this part
*/
variableInjectionFunctionWrapperEndCode(module, varExpressions, block) {
const firstParam = this.contextArgument(module, block);
const furtherParams = varExpressions.map(e => e.source()).join(", ");
return `}.call(${firstParam}, ${furtherParams}))`;
}
splitVariablesInUniqueNamedChunks(vars) {
const startState = [
[]
];
return vars.reduce((chunks, variable) => {
const current = chunks[chunks.length - 1];
// check if variable with same name exists already
// if so create a new chunk of variables.
const variableNameAlreadyExists = current.some(v => v.name === variable.name);
if(variableNameAlreadyExists) {
// start new chunk with current variable
chunks.push([variable]);
} else {
// else add it to current chunk
current.push(variable);
}
return chunks;
}, startState);
}
}
module.exports = JavascriptGenerator;

View File

@ -7,6 +7,7 @@
const Parser = require("./Parser");
const Template = require("./Template");
const ConcatSource = require("webpack-sources").ConcatSource;
const JavascriptGenerator = require("./JavascriptGenerator");
class JavascriptModulesPlugin {
apply(compiler) {
@ -22,6 +23,15 @@ class JavascriptModulesPlugin {
normalModuleFactory.hooks.createParser.for("javascript/esm").tap("JavascriptModulesPlugin", options => {
return new Parser(options, "module");
});
normalModuleFactory.hooks.createGenerator.for("javascript/auto").tap("JavascriptModulesPlugin", options => {
return new JavascriptGenerator(options);
});
normalModuleFactory.hooks.createGenerator.for("javascript/dynamic").tap("JavascriptModulesPlugin", options => {
return new JavascriptGenerator(options);
});
normalModuleFactory.hooks.createGenerator.for("javascript/esm").tap("JavascriptModulesPlugin", options => {
return new JavascriptGenerator(options);
});
compilation.mainTemplate.hooks.renderManifest.tap("JavascriptModulesPlugin", (result, options) => {
const chunk = options.chunk;
const hash = options.hash;

35
lib/JsonGenerator.js Normal file
View File

@ -0,0 +1,35 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
const stringifySafe = data => JSON.stringify(data)
.replace(/\u2028|\u2029/g, str => str === "\u2029" ? "\\u2029" : "\\u2028"); // invalid in JavaScript but valid JSON
class JsonGenerator {
generate(module, dependencyTemplates, runtimeTemplate) {
const source = new ConcatSource();
const data = module.buildInfo.jsonData;
if(Array.isArray(module.buildMeta.providedExports) && !module.isUsed("default")) {
// Only some exports are used: We can optimize here, by only generating a part of the JSON
const reducedJson = {};
for(const exportName of module.buildMeta.providedExports) {
if(exportName === "default")
continue;
const used = module.isUsed(exportName);
if(used) {
reducedJson[used] = data[exportName];
}
}
source.add(`${module.moduleArgument}.exports = ${stringifySafe(reducedJson)};`);
} else {
source.add(`${module.moduleArgument}.exports = ${stringifySafe(data)};`);
}
return source;
}
}
module.exports = JsonGenerator;

View File

@ -5,10 +5,7 @@
"use strict";
const JsonParser = require("./JsonParser");
const ConcatSource = require("webpack-sources").ConcatSource;
const stringifySafe = data => JSON.stringify(data)
.replace(/\u2028|\u2029/g, str => str === "\u2029" ? "\\u2029" : "\\u2028"); // invalid in JavaScript but valid JSON
const JsonGenerator = require("./JsonGenerator");
class JsonModulesPlugin {
apply(compiler) {
@ -18,29 +15,8 @@ class JsonModulesPlugin {
normalModuleFactory.hooks.createParser.for("json").tap("JsonModulesPlugin", () => {
return new JsonParser();
});
compilation.moduleTemplates.javascript.hooks.content.tap("JsonModulesPlugin", (moduleSource, module) => {
if(module.type && module.type.startsWith("json")) {
const source = new ConcatSource();
const data = module.buildInfo.jsonData;
if(Array.isArray(module.buildMeta.providedExports) && !module.isUsed("default")) {
// Only some exports are used: We can optimize here, by only generating a part of the JSON
const reducedJson = {};
for(const exportName of module.buildMeta.providedExports) {
if(exportName === "default")
continue;
const used = module.isUsed(exportName);
if(used) {
reducedJson[used] = data[exportName];
}
}
source.add(`${module.moduleArgument}.exports = ${stringifySafe(reducedJson)};`);
} else {
source.add(`${module.moduleArgument}.exports = ${stringifySafe(data)};`);
}
return source;
} else {
return moduleSource;
}
normalModuleFactory.hooks.createGenerator.for("json").tap("JsonModulesPlugin", () => {
return new JsonGenerator();
});
});
}

View File

@ -5,7 +5,7 @@
"use strict";
const path = require("path");
const asyncLib = require("async");
const asyncLib = require("neo-async");
class LibManifestPlugin {
constructor(options) {

View File

@ -25,9 +25,10 @@ const sortByDebugId = (a, b) => {
class Module extends DependenciesBlock {
constructor(type) {
constructor(type, context = null) {
super();
this.type = type;
this.context = context;
// Unique Id
this.debugId = debugId++;
@ -37,8 +38,6 @@ class Module extends DependenciesBlock {
this.renderedHash = undefined;
// Info from Factory
// TODO refactor: pass as constructor argument
this.context = null;
this.resolveOptions = EMPTY_RESOLVE_OPTIONS;
this.factoryMeta = {};

View File

@ -42,7 +42,7 @@ const getBefore = (str, token) => {
};
const getHash = str => {
const hash = createHash("md5");
const hash = createHash("md4");
hash.update(str);
return hash.digest("hex").substr(0, 4);
};
@ -112,24 +112,6 @@ ModuleFilenameHelpers.createFilename = (module, options, requestShortener) => {
.replace(ModuleFilenameHelpers.REGEXP_NAMESPACE, opts.namespace);
};
ModuleFilenameHelpers.createFooter = (module, requestShortener) => {
if(!module) module = "";
if(typeof module === "string") {
return [
"// WEBPACK FOOTER //",
`// ${requestShortener.shorten(module)}`
].join("\n");
} else {
return [
"//////////////////",
"// WEBPACK FOOTER",
`// ${module.readableIdentifier(requestShortener)}`,
`// module id = ${module.id}`,
`// module chunks = ${Array.from(module.chunksIterable, c => c.id).join(" ")}`
].join("\n");
}
};
ModuleFilenameHelpers.replaceDuplicates = (array, fn, comparator) => {
const countMap = Object.create(null);
const posMap = Object.create(null);

View File

@ -7,7 +7,7 @@
const Tapable = require("tapable").Tapable;
const SyncHook = require("tapable").SyncHook;
const MultiHook = require("tapable").MultiHook;
const asyncLib = require("async");
const asyncLib = require("neo-async");
const MultiWatching = require("./MultiWatching");
const MultiStats = require("./MultiStats");

View File

@ -11,10 +11,9 @@ const RawSource = require("webpack-sources").RawSource;
class MultiModule extends Module {
constructor(context, dependencies, name) {
super("javascript/dynamic");
super("javascript/dynamic", context);
// Info from Factory
this.context = context;
this.dependencies = dependencies;
this.name = name;
}

View File

@ -4,7 +4,7 @@
*/
"use strict";
const asyncLib = require("async");
const asyncLib = require("neo-async");
class MultiWatching {
constructor(watchings, compiler) {

View File

@ -10,7 +10,6 @@ const NativeModule = require("module");
const SourceMapSource = require("webpack-sources").SourceMapSource;
const OriginalSource = require("webpack-sources").OriginalSource;
const RawSource = require("webpack-sources").RawSource;
const ReplaceSource = require("webpack-sources").ReplaceSource;
const CachedSource = require("webpack-sources").CachedSource;
const LineToLineMappedSource = require("webpack-sources").LineToLineMappedSource;
@ -65,8 +64,18 @@ const dependencyTemplatesHashMap = new WeakMap();
class NormalModule extends Module {
constructor(type, request, userRequest, rawRequest, loaders, resource, parser, resolveOptions) {
super(type);
constructor({
type,
request,
userRequest,
rawRequest,
loaders,
resource,
parser,
generator,
resolveOptions
}) {
super(type, getContext(resource));
// Info from Factory
this.request = request;
@ -74,8 +83,8 @@ class NormalModule extends Module {
this.rawRequest = rawRequest;
this.binary = type.startsWith("webassembly");
this.parser = parser;
this.generator = generator;
this.resource = resource;
this.context = getContext(resource);
this.loaders = loaders;
if(resolveOptions !== undefined)
this.resolveOptions = resolveOptions;
@ -353,180 +362,19 @@ class NormalModule extends Module {
return `${this.hash}-${dtHash}`;
}
sourceDependency(dependency, dependencyTemplates, source, runtimeTemplate) {
const template = dependencyTemplates.get(dependency.constructor);
if(!template) throw new Error("No template for dependency: " + dependency.constructor.name);
template.apply(dependency, source, runtimeTemplate, dependencyTemplates);
}
sourceVariables(variable, availableVars, dependencyTemplates, runtimeTemplate) {
const name = variable.name;
const expr = variable.expressionSource(dependencyTemplates, runtimeTemplate);
if(availableVars.some(v => v.name === name && v.expression.source() === expr.source())) {
return;
}
return {
name: name,
expression: expr
};
}
/*
* creates the start part of a IIFE around the module to inject a variable name
* (function(...){ <- this part
* }.call(...))
*/
variableInjectionFunctionWrapperStartCode(varNames) {
const args = varNames.join(", ");
return `/* WEBPACK VAR INJECTION */(function(${args}) {`;
}
contextArgument(block) {
if(this === block) {
return this.exportsArgument;
}
return "this";
}
/*
* creates the end part of a IIFE around the module to inject a variable name
* (function(...){
* }.call(...)) <- this part
*/
variableInjectionFunctionWrapperEndCode(varExpressions, block) {
const firstParam = this.contextArgument(block);
const furtherParams = varExpressions.map(e => e.source()).join(", ");
return `}.call(${firstParam}, ${furtherParams}))`;
}
splitVariablesInUniqueNamedChunks(vars) {
const startState = [
[]
];
return vars.reduce((chunks, variable) => {
const current = chunks[chunks.length - 1];
// check if variable with same name exists already
// if so create a new chunk of variables.
const variableNameAlreadyExists = current.some(v => v.name === variable.name);
if(variableNameAlreadyExists) {
// start new chunk with current variable
chunks.push([variable]);
} else {
// else add it to current chunk
current.push(variable);
}
return chunks;
}, startState);
}
sourceBlock(block, availableVars, dependencyTemplates, source, runtimeTemplate) {
for(const dependency of block.dependencies) {
this.sourceDependency(dependency, dependencyTemplates, source, runtimeTemplate);
}
/**
* Get the variables of all blocks that we need to inject.
* These will contain the variable name and its expression.
* The name will be added as a paramter in a IIFE the expression as its value.
*/
const vars = block.variables.reduce((result, value) => {
const variable = this.sourceVariables(
value, availableVars, dependencyTemplates, runtimeTemplate);
if(variable) {
result.push(variable);
}
return result;
}, []);
/**
* if we actually have variables
* this is important as how #splitVariablesInUniqueNamedChunks works
* it will always return an array in an array which would lead to a IIFE wrapper around
* a module if we do this with an empty vars array.
*/
if(vars.length > 0) {
/**
* Split all variables up into chunks of unique names.
* e.g. imagine you have the following variable names that need to be injected:
* [foo, bar, baz, foo, some, more]
* we can not inject "foo" twice, therefore we just make two IIFEs like so:
* (function(foo, bar, baz){
* (function(foo, some, more){
* ...
* }(...));
* }(...));
*
* "splitVariablesInUniqueNamedChunks" splits the variables shown above up to this:
* [[foo, bar, baz], [foo, some, more]]
*/
const injectionVariableChunks = this.splitVariablesInUniqueNamedChunks(vars);
// create all the beginnings of IIFEs
const functionWrapperStarts = injectionVariableChunks.map((variableChunk) => {
return this.variableInjectionFunctionWrapperStartCode(
variableChunk.map(variable => variable.name)
);
});
// and all the ends
const functionWrapperEnds = injectionVariableChunks.map((variableChunk) => {
return this.variableInjectionFunctionWrapperEndCode(
variableChunk.map(variable => variable.expression), block
);
});
// join them to one big string
const varStartCode = functionWrapperStarts.join("");
// reverse the ends first before joining them, as the last added must be the inner most
const varEndCode = functionWrapperEnds.reverse().join("");
// if we have anything, add it to the source
if(varStartCode && varEndCode) {
const start = block.range ? block.range[0] : -10;
const end = block.range ? block.range[1] : (this._source.size() + 1);
source.insert(start + 0.5, varStartCode);
source.insert(end + 0.5, "\n/* WEBPACK VAR INJECTION */" + varEndCode);
}
}
for(const childBlock of block.blocks) {
this.sourceBlock(
childBlock,
availableVars.concat(vars),
dependencyTemplates,
source,
runtimeTemplate
);
}
}
source(dependencyTemplates, runtimeTemplate) {
if(this.type.startsWith("javascript")) {
const hashDigest = this.getHashDigest(dependencyTemplates);
if(this._cachedSourceHash === hashDigest) {
// We can reuse the cached source
return this._cachedSource;
}
if(!this._source) {
return new RawSource("throw new Error('No source available');");
}
const source = new ReplaceSource(this._source);
this.sourceBlock(this, [], dependencyTemplates, source, runtimeTemplate);
const cachedSource = new CachedSource(source);
this._cachedSource = cachedSource;
this._cachedSourceHash = hashDigest;
return cachedSource;
const hashDigest = this.getHashDigest(dependencyTemplates);
if(this._cachedSourceHash === hashDigest) {
// We can reuse the cached source
return this._cachedSource;
}
return this._source;
const source = this.generator.generate(this, dependencyTemplates, runtimeTemplate);
const cachedSource = new CachedSource(source);
this._cachedSource = cachedSource;
this._cachedSourceHash = hashDigest;
return cachedSource;
}
originalSource() {

View File

@ -4,7 +4,7 @@
*/
"use strict";
const asyncLib = require("async");
const asyncLib = require("neo-async");
const Tapable = require("tapable").Tapable;
const AsyncSeriesWaterfallHook = require("tapable").AsyncSeriesWaterfallHook;
const SyncWaterfallHook = require("tapable").SyncWaterfallHook;
@ -61,6 +61,8 @@ class NormalModuleFactory extends Tapable {
module: new SyncWaterfallHook(["module", "data"]),
createParser: new HookMap(() => new SyncBailHook(["parserOptions"])),
parser: new HookMap(() => new SyncHook(["parser", "parserOptions"])),
createGenerator: new HookMap(() => new SyncBailHook(["generatorOptions"])),
generator: new HookMap(() => new SyncHook(["generator", "generatorOptions"])),
};
this._pluginCompat.tap("NormalModuleFactory", options => {
switch(options.name) {
@ -89,6 +91,7 @@ class NormalModuleFactory extends Tapable {
this.cachePredicate = typeof options.unsafeCache === "function" ? options.unsafeCache : Boolean.bind(null, options.unsafeCache);
this.context = context || "";
this.parserCache = Object.create(null);
this.generatorCache = Object.create(null);
this.hooks.factory.tap("NormalModuleFactory", () => (result, callback) => {
let resolver = this.hooks.resolver.call(null);
@ -118,16 +121,7 @@ class NormalModuleFactory extends Tapable {
return callback(new Error("Empty dependency (no request)"));
}
createdModule = new NormalModule(
result.type,
result.request,
result.userRequest,
result.rawRequest,
result.loaders,
result.resource,
result.parser,
result.resolveOptions
);
createdModule = new NormalModule(result);
}
createdModule = this.hooks.module.call(createdModule, result);
@ -254,6 +248,7 @@ class NormalModuleFactory extends Tapable {
settings,
type,
parser: this.getParser(type, settings.parser),
generator: this.getGenerator(type, settings.generator),
resolveOptions
});
});
@ -349,6 +344,29 @@ class NormalModuleFactory extends Tapable {
return parser;
}
getGenerator(type, generatorOptions) {
let ident = type;
if(generatorOptions) {
if(generatorOptions.ident)
ident = `${type}|${generatorOptions.ident}`;
else
ident = JSON.stringify([type, generatorOptions]);
}
if(ident in this.generatorCache) {
return this.generatorCache[ident];
}
return this.generatorCache[ident] = this.createGenerator(type, generatorOptions);
}
createGenerator(type, generatorOptions = {}) {
const generator = this.hooks.createGenerator.for(type).call(generatorOptions);
if(!generator) {
throw new Error(`No generator registered for ${type}`);
}
this.hooks.generator.for(type).call(generator, generatorOptions);
return generator;
}
getResolver(type, resolveOptions) {
return this.resolverFactory.get(type, resolveOptions || EMPTY_RESOLVE_OPTIONS);
}

View File

@ -24,7 +24,7 @@ const joinRanges = (startRange, endRange) => {
const defaultParserOptions = {
ranges: true,
locations: true,
ecmaVersion: 2017,
ecmaVersion: 2018,
sourceType: "module",
onComment: null,
plugins: {
@ -609,9 +609,13 @@ class Parser extends Tapable {
if(classy.superClass)
this.walkExpression(classy.superClass);
if(classy.body && classy.body.type === "ClassBody") {
for(const methodDefinition of classy.body.body)
const wasTopLevel = this.scope.topLevelScope;
this.scope.topLevelScope = false;
for(const methodDefinition of classy.body.body) {
if(methodDefinition.type === "MethodDefinition")
this.walkMethodDefinition(methodDefinition);
}
this.scope.topLevelScope = wasTopLevel;
}
}
@ -1293,6 +1297,10 @@ class Parser extends Tapable {
walkObjectExpression(expression) {
for(let propIndex = 0, len = expression.properties.length; propIndex < len; propIndex++) {
const prop = expression.properties[propIndex];
if(prop.type === "SpreadElement") {
this.walkExpression(prop.argument);
continue;
}
if(prop.computed)
this.walkExpression(prop.key);
if(prop.shorthand)
@ -1852,7 +1860,7 @@ class Parser extends Tapable {
}
static parse(code, options) {
const type = options.sourceType;
const type = options ? options.sourceType : "module";
const parserOptions = Object.assign(Object.create(null), defaultParserOptions, options);
if(type === "auto") {

View File

@ -11,7 +11,7 @@ const RawSource = require("webpack-sources").RawSource;
module.exports = class RawModule extends Module {
constructor(source, identifier, readableIdentifier) {
super("javascript/dynamic");
super("javascript/dynamic", null);
this.sourceStr = source;
this.identifierStr = identifier || this.sourceStr;
this.readableIdentifierStr = readableIdentifier || this.identifierStr;

13
lib/RemovedPluginError.js Normal file
View File

@ -0,0 +1,13 @@
"use strict";
const WebpackError = require("./WebpackError");
module.exports = class RemovedPluginError extends WebpackError {
constructor(message) {
super();
this.message = message;
Error.captureStackTrace(this, this.constructor);
}
};

View File

@ -192,6 +192,7 @@ module.exports = class RuntimeTemplate {
exportFromImport({
module,
request,
exportName,
originModule,
asiSafe,
@ -199,6 +200,9 @@ module.exports = class RuntimeTemplate {
callContext,
importVar
}) {
if(!module) return this.missingModule({
request
});
const exportsType = module.buildMeta && module.buildMeta.exportsType;
if(!exportsType) {

View File

@ -184,9 +184,7 @@ class SourceMapDevToolPlugin {
const modules = task.modules;
const moduleFilenames = modules.map(m => moduleToSourceNameMapping.get(m));
sourceMap.sources = moduleFilenames;
if(sourceMap.sourcesContent && !options.noSources) {
sourceMap.sourcesContent = sourceMap.sourcesContent.map((content, i) => typeof content === "string" ? `${content}\n\n\n${ModuleFilenameHelpers.createFooter(modules[i], requestShortener)}` : null);
} else {
if(options.noSources) {
sourceMap.sourcesContent = undefined;
}
sourceMap.sourceRoot = options.sourceRoot || "";
@ -213,7 +211,7 @@ class SourceMapDevToolPlugin {
basename: basename(filename)
});
if(sourceMapFile.includes("[contenthash]")) {
sourceMapFile = sourceMapFile.replace(/\[contenthash\]/g, createHash("md5").update(sourceMapString).digest("hex"));
sourceMapFile = sourceMapFile.replace(/\[contenthash\]/g, createHash("md4").update(sourceMapString).digest("hex"));
}
const sourceMapUrl = options.publicPath ? options.publicPath + sourceMapFile.replace(/\\/g, "/") : path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/");
if(currentSourceMappingURLComment !== false) {

View File

@ -105,6 +105,7 @@ class Stats {
const showEnv = optionOrLocalFallback(options.env, false);
const showVersion = optionOrLocalFallback(options.version, true);
const showTimings = optionOrLocalFallback(options.timings, true);
const showBuiltAt = optionOrLocalFallback(options.builtAt, true);
const showAssets = optionOrLocalFallback(options.assets, true);
const showEntrypoints = optionOrLocalFallback(options.entrypoints, true);
const showChunks = optionOrLocalFallback(options.chunks, !forToString);
@ -133,6 +134,7 @@ class Stats {
const sortModules = optionsOrFallback(options.modulesSort, "id");
const sortChunks = optionsOrFallback(options.chunksSort, "id");
const sortAssets = optionsOrFallback(options.assetsSort, "");
const showOutputPath = optionOrLocalFallback(options.outputPath, !forToString);
if(!showCachedModules) {
excludeModules.push((ident, module) => !module.built);
@ -254,6 +256,10 @@ class Stats {
obj.time = this.endTime - this.startTime;
}
if(showBuiltAt && this.endTime) {
obj.builtAt = this.endTime;
}
if(showEnv && options._env) {
obj.env = options._env;
}
@ -266,6 +272,9 @@ class Stats {
hash: this.compilation.hash
});
}
if(showOutputPath) {
obj.outputPath = this.compilation.mainTemplate.outputOptions.path;
}
if(showAssets) {
const assetsByFile = {};
const compilationAssets = Object.keys(compilation.assets);
@ -439,9 +448,9 @@ class Stats {
names: chunk.name ? [chunk.name] : [],
files: chunk.files.slice(),
hash: chunk.renderedHash,
siblings: Array.from(siblings),
parents: Array.from(parents),
children: Array.from(children)
siblings: Array.from(siblings).sort(),
parents: Array.from(parents).sort(),
children: Array.from(children).sort()
};
if(showChunkModules) {
obj.modules = chunk
@ -463,7 +472,17 @@ class Stats {
loc: formatLocation(origin.loc),
request: origin.request,
reasons: origin.reasons || []
}));
})).sort((a, b) => {
if(typeof a.moduleId === "number" && typeof b.moduleId !== "number") return 1;
if(typeof a.moduleId !== "number" && typeof b.moduleId === "number") return -1;
if(typeof a.moduleId === "number" && typeof b.moduleId === "number") {
const diffId = a.moduleId - b.moduleId;
if(diffId !== 0) return diffId;
}
if(a.loc < b.loc) return -1;
if(a.loc > b.loc) return 1;
return 0;
});
}
return obj;
});
@ -616,6 +635,14 @@ class Stats {
colors.normal("ms");
newline();
}
if(typeof obj.builtAt === "number") {
const builtAtDate = new Date(obj.builtAt);
colors.normal("Built at: ");
colors.normal(builtAtDate.toLocaleDateString());
colors.normal(" ");
colors.bold(builtAtDate.toLocaleTimeString());
newline();
}
if(obj.env) {
colors.normal("Environment (--env): ");
colors.bold(JSON.stringify(obj.env, null, 2));

View File

@ -59,11 +59,13 @@ class Watching {
const stats = new Stats(compilation);
stats.startTime = this.startTime;
stats.endTime = Date.now();
this.compiler.hooks.done.call(stats);
this.compiler.hooks.additionalPass.callAsync(err => {
this.compiler.hooks.done.callAsync(stats, err => {
if(err) return this._done(err);
this.compiler.compile(onCompiled);
this.compiler.hooks.additionalPass.callAsync(err => {
if(err) return this._done(err);
this.compiler.compile(onCompiled);
});
});
return;
}
@ -93,13 +95,14 @@ class Watching {
return;
}
this.compiler.hooks.done.call(stats);
this.handler(null, stats);
if(!this.closed) {
this.watch(Array.from(compilation.fileDependencies), Array.from(compilation.contextDependencies), Array.from(compilation.missingDependencies));
}
for(const cb of this.callbacks) cb();
this.callbacks.length = 0;
this.compiler.hooks.done.callAsync(stats, () => {
this.handler(null, stats);
if(!this.closed) {
this.watch(Array.from(compilation.fileDependencies), Array.from(compilation.contextDependencies), Array.from(compilation.missingDependencies));
}
for(const cb of this.callbacks) cb();
this.callbacks.length = 0;
});
}
watch(files, dirs, missing) {

View File

@ -0,0 +1,13 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class WebAssemblyGenerator {
generate(module) {
return module.originalSource();
}
}
module.exports = WebAssemblyGenerator;

View File

@ -5,6 +5,7 @@
"use strict";
const WebAssemblyParser = require("./WebAssemblyParser");
const WebAssemblyGenerator = require("./WebAssemblyGenerator");
const WebAssemblyImportDependency = require("./dependencies/WebAssemblyImportDependency");
class WebAssemblyModulesPlugin {
@ -18,6 +19,10 @@ class WebAssemblyModulesPlugin {
return new WebAssemblyParser();
});
normalModuleFactory.hooks.createGenerator.for("webassembly/experimental").tap("WebAssemblyModulesPlugin", () => {
return new WebAssemblyGenerator();
});
compilation.chunkTemplate.hooks.renderManifest.tap("WebAssemblyModulesPlugin", (result, options) => {
const chunk = options.chunk;
const outputOptions = options.outputOptions;

View File

@ -138,7 +138,9 @@ class WebpackOptionsApply extends OptionsApply {
"app",
"auto-updater",
"browser-window",
"clipboard",
"content-tracing",
"crash-reporter",
"dialog",
"electron",
"global-shortcut",
@ -146,17 +148,16 @@ class WebpackOptionsApply extends OptionsApply {
"ipc-main",
"menu",
"menu-item",
"native-image",
"original-fs",
"power-monitor",
"power-save-blocker",
"protocol",
"session",
"web-contents",
"tray",
"clipboard",
"crash-reporter",
"native-image",
"screen",
"shell"
"session",
"shell",
"tray",
"web-contents"
]).apply(compiler);
new LoaderTargetPlugin(options.target).apply(compiler);
break;
@ -168,17 +169,18 @@ class WebpackOptionsApply extends OptionsApply {
new FunctionModulePlugin(options.output).apply(compiler);
new NodeTargetPlugin().apply(compiler);
new ExternalsPlugin("commonjs", [
"clipboard",
"crash-reporter",
"desktop-capturer",
"electron",
"ipc",
"ipc-renderer",
"remote",
"web-frame",
"clipboard",
"crash-reporter",
"native-image",
"original-fs",
"remote",
"screen",
"shell"
"shell",
"web-frame"
]).apply(compiler);
new LoaderTargetPlugin(options.target).apply(compiler);
break;
@ -274,7 +276,7 @@ class WebpackOptionsApply extends OptionsApply {
new RemoveParentModulesPlugin().apply(compiler);
if(options.optimization.removeEmptyChunks)
new RemoveEmptyChunksPlugin().apply(compiler);
if(options.optimization.mergedDuplicateChunks)
if(options.optimization.mergeDuplicateChunks)
new MergeDuplicateChunksPlugin().apply(compiler);
if(options.optimization.flagIncludedChunks)
new FlagIncludedChunksPlugin().apply(compiler);
@ -291,7 +293,7 @@ class WebpackOptionsApply extends OptionsApply {
if(options.optimization.splitChunks)
new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler);
if(options.optimization.runtimeChunk)
new RuntimeChunkPlugin().apply(compiler);
new RuntimeChunkPlugin(options.optimization.runtimeChunk).apply(compiler);
if(options.optimization.noEmitOnErrors)
new NoEmitOnErrorsPlugin().apply(compiler);
if(options.optimization.namedModules)

View File

@ -41,13 +41,16 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
this.set("module.strictThisContextOnImports", false);
this.set("module.unsafeCache", "make", options => !!options.cache);
this.set("module.rules", []);
this.set("module.defaultRules", [{
this.set("module.defaultRules", "make", options => [{
type: "javascript/auto",
resolve: {}
},
{
test: /\.mjs$/i,
type: "javascript/esm"
type: "javascript/esm",
resolve: {
mainFields: options.target === "web" || options.target === "webworker" ? ["browser", "main"] : ["main"]
}
},
{
test: /\.json$/i,
@ -122,7 +125,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
this.set("output.crossOriginLoading", false);
this.set("output.jsonpScriptType", false);
this.set("output.chunkLoadTimeout", 120000);
this.set("output.hashFunction", "md5");
this.set("output.hashFunction", "md4");
this.set("output.hashDigest", "hex");
this.set("output.hashDigestLength", 20);
this.set("output.devtoolLineToLine", false);
@ -157,7 +160,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
this.set("optimization.removeAvailableModules", true);
this.set("optimization.removeEmptyChunks", true);
this.set("optimization.mergedDuplicateChunks", true);
this.set("optimization.mergeDuplicateChunks", true);
this.set("optimization.flagIncludedChunks", "make", options => isProductionLikeMode(options));
this.set("optimization.occurrenceOrder", "make", options => isProductionLikeMode(options));
this.set("optimization.sideEffects", "make", options => isProductionLikeMode(options));
@ -181,6 +184,19 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
test: /[\\/]node_modules[\\/]/,
priority: -10
});
this.set("optimization.runtimeChunk", "call", value => {
if(value === "single") {
return {
name: "runtime"
};
}
if(value === true || value === "multiple") {
return {
name: entrypoint => `runtime~${entrypoint.name}`
};
}
return value;
});
this.set("optimization.noEmitOnErrors", "make", options => isProductionLikeMode(options));
this.set("optimization.namedModules", "make", options => options.mode === "development");
this.set("optimization.namedChunks", "make", options => options.mode === "development");
@ -197,7 +213,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
}).apply(compiler);
}
}]);
this.set("optimization.nodeEnv", "make", options => options.mode);
this.set("optimization.nodeEnv", "make", options => options.mode || "production");
this.set("resolve", "call", value => Object.assign({}, value));
this.set("resolve.unsafeCache", true);

View File

@ -1,5 +1,7 @@
const fs = require("fs");
const Trace = require("chrome-trace-event").Tracer;
const validateOptions = require("schema-utils");
const schema = require("../../schemas/plugins/debug/ProfilingPlugin.json");
let inspector = undefined;
try {
@ -8,17 +10,6 @@ try {
console.log("Unable to CPU profile in < node 8.0");
}
// TODO: Add this to webpack.js.org docs for this plugin, and for profiling build times
/**
* How this plugin works: (placeholder until in docs)
*
* In chrome, open the `Profile Tab`, when you run webpack,
* this plugin will output an events.json file that you
* can drag and drop into the profiler. It will then display timeline stats and calls per plugin!
*
* Example: https://chromedevtools.github.io/timeline-viewer/?url=https%3A%2F%2Fgist.githubusercontent.com%2FTheLarkInn%2Fb94b728fa5e22f62c312e110a9944768%2Fraw%2Fcb672fb3f661a17576803e41db6030382b1a0fc9%2Fevents.json&loadTimelineFromURL=drive://163GY-H0wvF9rSrlwjJcrdTL-YLnppp55
*/
class Profiler {
constructor(inspector) {
this.session = undefined;
@ -81,10 +72,10 @@ class Profiler {
}
/**
* @param {string} outPath The location where to write the log.
* @param {string} outputPath The location where to write the log.
* @returns {{trace: ?, counter: number, profiler: Profiler}} The trace object
*/
function createTrace(outPath) {
function createTrace(outputPath) {
const trace = new Trace({
noStream: true
});
@ -92,7 +83,7 @@ function createTrace(outPath) {
let counter = 0;
trace.pipe(fs.createWriteStream(outPath));
trace.pipe(fs.createWriteStream(outputPath));
// These are critical events that need to be inserted so that tools like
// chrome dev tools can load the profile.
trace.instantEvent({
@ -130,15 +121,17 @@ function createTrace(outPath) {
};
}
const pluginName = "ProfilingPlugin";
class ProfilingPlugin {
// TODO: Add plugin schema validation here since there are options.
constructor(opts) {
validateOptions(schema, opts || {}, "Profiling plugin");
opts = opts || {};
this.outPath = opts.outPath || "events.json";
this.outputPath = opts.outputPath || "events.json";
}
apply(compiler) {
const tracer = createTrace(this.outPath);
const tracer = createTrace(this.outputPath);
tracer.profiler.startProfiling();
// Compiler Hooks
@ -150,7 +143,7 @@ class ProfilingPlugin {
compiler.resolverFactory.hooks[hookName].intercept(makeInterceptorFor("Resolver", tracer)(hookName));
});
compiler.hooks.compilation.tap("ProfilingPlugin", (compilation, {
compiler.hooks.compilation.tap(pluginName, (compilation, {
normalModuleFactory,
contextModuleFactory
}) => {
@ -163,7 +156,7 @@ class ProfilingPlugin {
// We need to write out the CPU profile when we are all done.
compiler.hooks.done.tap({
name: "ProfilingPlugin",
name: pluginName,
stage: Infinity
}, () => {
tracer.profiler.stopProfiling().then((parsedResults) => {
@ -264,9 +257,11 @@ const interceptTemplateInstancesFrom = (compilation, tracer) => {
};
const interceptAllHooksFor = (instance, tracer, logLabel) => {
Object.keys(instance.hooks).forEach(hookName => {
instance.hooks[hookName].intercept(makeInterceptorFor(logLabel, tracer)(hookName));
});
if(Reflect.has(instance, "hooks")) {
Object.keys(instance.hooks).forEach(hookName => {
instance.hooks[hookName].intercept(makeInterceptorFor(logLabel, tracer)(hookName));
});
}
};
const interceptAllParserHooks = (moduleFactory, tracer) => {
@ -356,6 +351,12 @@ const makeNewProfiledTapFn = (hookName, tracer, {
case "sync":
return(...args) => { // eslint-disable-line
const id = ++tracer.counter;
// Do not instrument outself due to the CPU
// profile needing to be the last event in the trace.
if(name === pluginName) {
return fn(...args);
}
tracer.trace.begin({
name,
id,

View File

@ -104,6 +104,7 @@ HarmonyImportSpecifierDependency.Template = class HarmonyImportSpecifierDependen
getContent(dep, runtime) {
const exportExpr = runtime.exportFromImport({
module: dep.module,
request: dep.request,
exportName: dep.id,
originModule: dep.originModule,
asiSafe: dep.shorthand,

View File

@ -6,9 +6,11 @@
const ExternalsPlugin = require("../ExternalsPlugin");
const builtins = require("module").builtinModules || Object.keys(process.binding("natives"));
class NodeTargetPlugin {
apply(compiler) {
new ExternalsPlugin("commonjs", Object.keys(process.binding("natives"))).apply(compiler);
new ExternalsPlugin("commonjs", builtins).apply(compiler);
}
}

Some files were not shown because too many files have changed in this diff Show More