diff --git a/bin/webpack.js b/bin/webpack.js index 3d696078081..fbd31f026d4 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -68,6 +68,11 @@ yargs.options({ group: DISPLAY_GROUP, describe: "Display chunks in the output" }, + "display-entrypoints": { + type: "boolean", + group: DISPLAY_GROUP, + describe: "Display entry points in the output" + }, "display-origins": { type: "boolean", group: DISPLAY_GROUP, @@ -110,6 +115,7 @@ var argv = yargs.argv; if(argv.verbose) { argv["display-reasons"] = true; + argv["display-entrypoints"] = true; argv["display-used-exports"] = true; argv["display-error-details"] = true; argv["display-modules"] = true; @@ -185,6 +191,10 @@ function processOptions(options) { outputOptions.chunks = bool; }); + ifArg("display-entrypoints", function(bool) { + outputOptions.entrypoints = bool; + }); + ifArg("display-reasons", function(bool) { outputOptions.reasons = bool; }); @@ -216,6 +226,8 @@ function processOptions(options) { } else { if(typeof outputOptions.chunks === "undefined") outputOptions.chunks = true; + if(typeof outputOptions.entrypoints === "undefined") + outputOptions.entrypoints = true; if(typeof outputOptions.modules === "undefined") outputOptions.modules = true; if(typeof outputOptions.chunkModules === "undefined") diff --git a/examples/build-common.js b/examples/build-common.js index c3c8089695f..bf0cc9f7cb6 100644 --- a/examples/build-common.js +++ b/examples/build-common.js @@ -11,7 +11,7 @@ var extraArgs = ""; var targetArgs = global.NO_TARGET_ARGS ? "" : " ./example.js js/output.js"; var displayReasons = global.NO_REASONS ? "" : " --display-reasons --display-used-exports"; (function doIt(remainingTimes) { - cp.exec("node ../../bin/webpack.js" + displayReasons + " --display-chunks --display-modules --display-origins --output-public-path \"js/\" -p " + extraArgs + targetArgs, function (error, stdout, stderr) { + cp.exec("node ../../bin/webpack.js" + displayReasons + " --display-chunks --display-modules --display-origins --display-entrypoints --output-public-path \"js/\" -p " + extraArgs + targetArgs, function (error, stdout, stderr) { if(stderr && remainingTimes === 1) console.log(stderr); if (error !== null && remainingTimes === 1) @@ -22,7 +22,7 @@ var displayReasons = global.NO_REASONS ? "" : " --display-reasons --display-used console.log(stderr); throw e; } - cp.exec("node ../../bin/webpack.js" + displayReasons + " --display-chunks --display-modules --display-origins --output-public-path \"js/\" --output-pathinfo " + extraArgs + targetArgs, function (error, stdout, stderr) { + cp.exec("node ../../bin/webpack.js" + displayReasons + " --display-chunks --display-modules --display-origins --display-entrypoints --output-public-path \"js/\" --output-pathinfo " + extraArgs + targetArgs, function (error, stdout, stderr) { if(remainingTimes === 1) console.log(stdout); if(stderr && remainingTimes === 1) diff --git a/examples/http2-aggressive-splitting/README.md b/examples/http2-aggressive-splitting/README.md new file mode 100644 index 00000000000..8477e1e1f0d --- /dev/null +++ b/examples/http2-aggressive-splitting/README.md @@ -0,0 +1,843 @@ +# Info + +## Uncompressed + +``` +Hash: db9e88642ccb12a1264f +Version: webpack 2.1.0-beta.15 +Time: 1010ms + Asset Size Chunks Chunk Names +8fcb4106a762189b462e.js 52.9 kB 7 [emitted] +42f9c68ce2db0b310159.js 55.7 kB 0 [emitted] +c24df64c9d1be3f14bed.js 54.5 kB 2 [emitted] +c9045e231c8edbc788ae.js 53.7 kB 3 [emitted] +cbb6123321cf7cb9fde9.js 53.9 kB 4 [emitted] +a2919251072756ed702d.js 52.6 kB 5 [emitted] +71a18b9485bf6fa9a2d0.js 52.6 kB 6 [emitted] +195c9326275620b0e9c2.js 54.4 kB 1 [emitted] +9ae8368950c8db526738.js 51.8 kB 8 [emitted] +d360e87fdf3111b702b6.js 50.8 kB 9 [emitted] +cc545b839be6a4ff018f.js 50 kB 10 [emitted] +ae79591633a901193537.js 59.7 kB 11 [emitted] +754fd6b76d55855b537f.js 20.1 kB 12 [emitted] +c3adbf94e7e39acf7373.js 33.8 kB 13 [emitted] +Entrypoint main = ae79591633a901193537.js 754fd6b76d55855b537f.js c3adbf94e7e39acf7373.js +chunk {0} 42f9c68ce2db0b310159.js 49.9 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [25] (webpack)/~/react-dom/index.js 63 bytes {0} [built] + [31] (webpack)/~/fbjs/lib/ExecutionEnvironment.js 1.06 kB {0} [built] + [64] (webpack)/~/fbjs/lib/EventListener.js 2.67 kB {0} [built] + [65] (webpack)/~/fbjs/lib/focusNode.js 704 bytes {0} [built] + [66] (webpack)/~/fbjs/lib/getActiveElement.js 895 bytes {0} [built] + [67] (webpack)/~/fbjs/lib/shallowEqual.js 1.66 kB {0} [built] + [68] (webpack)/~/react/lib/CSSProperty.js 3.69 kB {0} [built] + [72] (webpack)/~/react/lib/ReactDOMComponentFlags.js 471 bytes {0} [built] + [89] (webpack)/~/fbjs/lib/camelize.js 708 bytes {0} [built] + [90] (webpack)/~/fbjs/lib/camelizeStyleName.js 1 kB {0} [built] + [91] (webpack)/~/fbjs/lib/containsNode.js 1.05 kB {0} [built] + [92] (webpack)/~/fbjs/lib/createArrayFromMixed.js 4.11 kB {0} [built] + [93] (webpack)/~/fbjs/lib/createNodesFromMarkup.js 2.66 kB {0} [built] + [94] (webpack)/~/fbjs/lib/getMarkupWrap.js 3.04 kB {0} [built] + [95] (webpack)/~/fbjs/lib/getUnboundedScrollPosition.js 1.05 kB {0} [built] + [96] (webpack)/~/fbjs/lib/hyphenate.js 800 bytes {0} [built] + [97] (webpack)/~/fbjs/lib/hyphenateStyleName.js 974 bytes {0} [built] + [98] (webpack)/~/fbjs/lib/isNode.js 693 bytes {0} [built] + [99] (webpack)/~/fbjs/lib/isTextNode.js 605 bytes {0} [built] + [100] (webpack)/~/fbjs/lib/memoizeStringOnly.js 698 bytes {0} [built] + [101] (webpack)/~/react/lib/AutoFocusUtils.js 633 bytes {0} [built] + [102] (webpack)/~/react/lib/BeforeInputEventPlugin.js 13.9 kB {0} [built] + [103] (webpack)/~/react/lib/CSSPropertyOperations.js 6.85 kB {0} [built] +chunk {1} 195c9326275620b0e9c2.js 49.2 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [47] (webpack)/~/react/lib/escapeTextContentForBrowser.js 3.48 kB {1} [built] + [48] (webpack)/~/react/lib/setInnerHTML.js 3.91 kB {1} [built] + [58] (webpack)/~/react/lib/getEventCharCode.js 1.54 kB {1} [built] + [59] (webpack)/~/react/lib/getEventModifierState.js 1.27 kB {1} [built] + [60] (webpack)/~/react/lib/getEventTarget.js 1.04 kB {1} [built] + [61] (webpack)/~/react/lib/isEventSupported.js 1.97 kB {1} [built] + [62] (webpack)/~/react/lib/shouldUpdateReactComponent.js 1.45 kB {1} [built] + [63] (webpack)/~/react/lib/validateDOMNesting.js 13.1 kB {1} [built] + [83] (webpack)/~/react/lib/forEachAccumulated.js 893 bytes {1} [built] + [84] (webpack)/~/react/lib/getHostComponentFromComposite.js 789 bytes {1} [built] + [85] (webpack)/~/react/lib/getTextContentAccessor.js 997 bytes {1} [built] + [86] (webpack)/~/react/lib/instantiateReactComponent.js 5.68 kB {1} [built] + [87] (webpack)/~/react/lib/isTextInputElement.js 1.08 kB {1} [built] + [88] (webpack)/~/react/lib/setTextContent.js 1.4 kB {1} [built] + [155] (webpack)/~/react/lib/flattenChildren.js 2.31 kB {1} [built] + [156] (webpack)/~/react/lib/getEventKey.js 2.9 kB {1} [built] + [157] (webpack)/~/react/lib/getNodeForCharacterOffset.js 1.66 kB {1} [built] + [158] (webpack)/~/react/lib/getVendorPrefixedEventName.js 2.92 kB {1} [built] + [159] (webpack)/~/react/lib/quoteAttributeValueForBrowser.js 749 bytes {1} [built] +chunk {2} c24df64c9d1be3f14bed.js 49.7 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [41] (webpack)/~/react/lib/ReactInstanceMap.js 1.26 kB {2} [built] + [55] (webpack)/~/react/lib/ReactErrorUtils.js 2.26 kB {2} [built] + [75] (webpack)/~/react/lib/ReactFeatureFlags.js 665 bytes {2} [built] + [76] (webpack)/~/react/lib/ReactHostComponent.js 2.42 kB {2} [built] + [77] (webpack)/~/react/lib/ReactInputSelection.js 4.31 kB {2} [built] + [79] (webpack)/~/react/lib/ReactMultiChildUpdateTypes.js 864 bytes {2} [built] + [80] (webpack)/~/react/lib/ReactNodeTypes.js 1.06 kB {2} [built] + [124] (webpack)/~/react/lib/ReactDOMTextarea.js 6.36 kB {2} [built] + [126] (webpack)/~/react/lib/ReactDefaultBatchingStrategy.js 1.92 kB {2} [built] + [127] (webpack)/~/react/lib/ReactDefaultInjection.js 3.4 kB {2} [built] + [129] (webpack)/~/react/lib/ReactEventListener.js 5.38 kB {2} [built] + [130] (webpack)/~/react/lib/ReactInjection.js 1.31 kB {2} [built] + [131] (webpack)/~/react/lib/ReactMarkupChecksum.js 1.51 kB {2} [built] + [132] (webpack)/~/react/lib/ReactMultiChild.js 14.6 kB {2} [built] + [135] (webpack)/~/react/lib/ReactRef.js 2.35 kB {2} [built] +chunk {3} c9045e231c8edbc788ae.js 49.8 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [42] (webpack)/~/react/lib/SyntheticUIEvent.js 1.61 kB {3} [built] + [43] (webpack)/~/react/lib/Transaction.js 9.61 kB {3} [built] + [46] (webpack)/~/react/lib/SyntheticMouseEvent.js 2.18 kB {3} [built] + [57] (webpack)/~/react/lib/createMicrosoftUnsafeLocalFunction.js 864 bytes {3} [built] + [82] (webpack)/~/react/lib/accumulateInto.js 1.73 kB {3} [built] + [140] (webpack)/~/react/lib/SimpleEventPlugin.js 18.8 kB {3} [built] + [148] (webpack)/~/react/lib/SyntheticTouchEvent.js 1.32 kB {3} [built] + [149] (webpack)/~/react/lib/SyntheticTransitionEvent.js 1.27 kB {3} [built] + [150] (webpack)/~/react/lib/SyntheticWheelEvent.js 1.98 kB {3} [built] + [151] (webpack)/~/react/lib/adler32.js 1.22 kB {3} [built] + [152] (webpack)/~/react/lib/checkReactTypeSpec.js 3.68 kB {3} [built] + [153] (webpack)/~/react/lib/dangerousStyleValue.js 3.06 kB {3} [built] + [154] (webpack)/~/react/lib/findDOMNode.js 2.49 kB {3} [built] +chunk {4} cbb6123321cf7cb9fde9.js 50 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [30] (webpack)/~/react/lib/ReactDOMComponentTree.js 6.2 kB {4} [built] + [32] (webpack)/~/react/lib/ReactInstrumentation.js 559 bytes {4} [built] + [45] (webpack)/~/react/lib/ReactBrowserEventEmitter.js 12.5 kB {4} [built] + [74] (webpack)/~/react/lib/ReactEmptyComponent.js 743 bytes {4} [built] + [110] (webpack)/~/react/lib/ReactChildReconciler.js 5.2 kB {4} [built] + [112] (webpack)/~/react/lib/ReactDOM.js 4.66 kB {4} [built] + [115] (webpack)/~/react/lib/ReactDOMContainerInfo.js 1.01 kB {4} [built] + [116] (webpack)/~/react/lib/ReactDOMEmptyComponent.js 1.95 kB {4} [built] + [117] (webpack)/~/react/lib/ReactDOMFeatureFlags.js 460 bytes {4} [built] + [118] (webpack)/~/react/lib/ReactDOMIDOperations.js 996 bytes {4} [built] + [119] (webpack)/~/react/lib/ReactDOMInput.js 11.4 kB {4} [built] + [120] (webpack)/~/react/lib/ReactDOMInstrumentation.js 571 bytes {4} [built] + [121] (webpack)/~/react/lib/ReactDOMOption.js 3.73 kB {4} [built] +chunk {5} a2919251072756ed702d.js 49.6 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [33] (webpack)/~/react/lib/ReactUpdates.js 9.6 kB {5} [built] + [35] (webpack)/~/react/lib/SyntheticEvent.js 8.73 kB {5} [built] + [56] (webpack)/~/react/lib/ReactUpdateQueue.js 8.97 kB {5} [built] + [138] (webpack)/~/react/lib/SVGDOMPropertyConfig.js 7.32 kB {5} [built] + [139] (webpack)/~/react/lib/SelectEventPlugin.js 6.49 kB {5} [built] + [142] (webpack)/~/react/lib/SyntheticClipboardEvent.js 1.21 kB {5} [built] + [143] (webpack)/~/react/lib/SyntheticCompositionEvent.js 1.14 kB {5} [built] + [144] (webpack)/~/react/lib/SyntheticDragEvent.js 1.11 kB {5} [built] + [145] (webpack)/~/react/lib/SyntheticFocusEvent.js 1.1 kB {5} [built] + [146] (webpack)/~/react/lib/SyntheticInputEvent.js 1.13 kB {5} [built] + [147] (webpack)/~/react/lib/SyntheticKeyboardEvent.js 2.75 kB {5} [built] +chunk {6} 71a18b9485bf6fa9a2d0.js 49.8 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [34] (webpack)/~/react/lib/EventConstants.js 2.17 kB {6} [built] + [39] (webpack)/~/react/lib/EventPluginHub.js 8.06 kB {6} [built] + [40] (webpack)/~/react/lib/EventPropagators.js 5.32 kB {6} [built] + [51] (webpack)/~/react/lib/EventPluginRegistry.js 9.48 kB {6} [built] + [52] (webpack)/~/react/lib/EventPluginUtils.js 8.17 kB {6} [built] + [53] (webpack)/~/react/lib/LinkedValueUtils.js 5.19 kB {6} [built] + [54] (webpack)/~/react/lib/ReactComponentEnvironment.js 1.72 kB {6} [built] + [71] (webpack)/~/react/lib/ReactComponentBrowserEnvironment.js 1.24 kB {6} [built] + [108] (webpack)/~/react/lib/FallbackCompositionState.js 2.47 kB {6} [built] + [109] (webpack)/~/react/lib/HTMLDOMPropertyConfig.js 5.35 kB {6} [built] + [113] (webpack)/~/react/lib/ReactDOMButton.js 634 bytes {6} [built] +chunk {7} 8fcb4106a762189b462e.js 49.9 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [36] (webpack)/~/react/lib/DOMLazyTree.js 3.75 kB {7} [built] + [37] (webpack)/~/react/lib/DOMProperty.js 8.13 kB {7} [built] + [44] (webpack)/~/react/lib/DisabledInputUtils.js 1.16 kB {7} [built] + [49] (webpack)/~/react/lib/DOMChildrenOperations.js 7.3 kB {7} [built] + [50] (webpack)/~/react/lib/DOMNamespaces.js 538 bytes {7} [built] + [69] (webpack)/~/react/lib/CallbackQueue.js 2.73 kB {7} [built] + [70] (webpack)/~/react/lib/DOMPropertyOperations.js 7.85 kB {7} [built] + [104] (webpack)/~/react/lib/ChangeEventPlugin.js 11.5 kB {7} [built] + [105] (webpack)/~/react/lib/Danger.js 2.27 kB {7} [built] + [106] (webpack)/~/react/lib/DefaultEventPluginOrder.js 1.26 kB {7} [built] + [107] (webpack)/~/react/lib/EnterLeaveEventPlugin.js 3.46 kB {7} [built] +chunk {8} 9ae8368950c8db526738.js 49.8 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [38] (webpack)/~/react/lib/ReactReconciler.js 7.11 kB {8} [built] + [78] (webpack)/~/react/lib/ReactMount.js 24.6 kB {8} [built] + [81] (webpack)/~/react/lib/ViewportMetrics.js 641 bytes {8} [built] + [133] (webpack)/~/react/lib/ReactOwner.js 3.6 kB {8} [built] + [134] (webpack)/~/react/lib/ReactReconcileTransaction.js 5.31 kB {8} [built] + [136] (webpack)/~/react/lib/ReactServerRenderingTransaction.js 2.35 kB {8} [built] + [137] (webpack)/~/react/lib/ReactServerUpdateQueue.js 4.95 kB {8} [built] + [141] (webpack)/~/react/lib/SyntheticAnimationEvent.js 1.25 kB {8} [built] +chunk {9} d360e87fdf3111b702b6.js 49.8 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [114] (webpack)/~/react/lib/ReactDOMComponent.js 38.9 kB {9} [built] + [123] (webpack)/~/react/lib/ReactDOMTextComponent.js 6.14 kB {9} [built] + [125] (webpack)/~/react/lib/ReactDOMTreeTraversal.js 3.74 kB {9} [built] + [128] (webpack)/~/react/lib/ReactEventEmitterMixin.js 1 kB {9} [built] +chunk {10} cc545b839be6a4ff018f.js 49.9 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [73] (webpack)/~/react/lib/ReactDOMSelect.js 6.9 kB {10} [built] + [111] (webpack)/~/react/lib/ReactCompositeComponent.js 35.7 kB {10} [built] + [122] (webpack)/~/react/lib/ReactDOMSelection.js 6.81 kB {10} [built] + [160] (webpack)/~/react/lib/renderSubtreeIntoContainer.js 466 bytes {10} [built] +chunk {11} ae79591633a901193537.js 49.8 kB [entry] [rendered] [recorded] + > aggressive-splitted main [29] ./example.js + [0] (webpack)/~/react/lib/ReactElement.js 12.2 kB {11} [built] + [1] (webpack)/~/fbjs/lib/invariant.js 1.49 kB {11} [built] + [2] (webpack)/~/fbjs/lib/warning.js 1.75 kB {11} [built] + [4] (webpack)/~/object-assign/index.js 1.99 kB {11} [built] + [5] (webpack)/~/fbjs/lib/emptyFunction.js 1.08 kB {11} [built] + [6] (webpack)/~/react/lib/ReactCurrentOwner.js 657 bytes {11} [built] + [7] (webpack)/~/fbjs/lib/emptyObject.js 458 bytes {11} [built] + [8] (webpack)/~/fbjs/lib/keyMirror.js 1.25 kB {11} [built] + [9] (webpack)/~/react/lib/ReactPropTypeLocationNames.js 614 bytes {11} [built] + [10] (webpack)/~/react/lib/ReactComponent.js 4.64 kB {11} [built] + [11] (webpack)/~/react/lib/ReactNoopUpdateQueue.js 3.4 kB {11} [built] + [14] (webpack)/~/react/react.js 56 bytes {11} [built] + [15] (webpack)/~/fbjs/lib/keyOf.js 1.1 kB {11} [built] + [16] (webpack)/~/react/lib/PooledClass.js 3.59 kB {11} [built] + [17] (webpack)/~/react/lib/KeyEscapeUtils.js 1.33 kB {11} [built] + [18] (webpack)/~/react/lib/ReactPropTypeLocations.js 552 bytes {11} [built] + [20] (webpack)/~/react/lib/ReactChildren.js 6.22 kB {11} [built] + [24] (webpack)/~/fbjs/lib/mapObject.js 1.44 kB {11} [built] + [26] (webpack)/~/react/lib/React.js 2.62 kB {11} [built] + [27] (webpack)/~/react/lib/ReactDOMFactories.js 3.34 kB {11} [built] +chunk {12} 754fd6b76d55855b537f.js 18.5 kB [initial] [rendered] + > aggressive-splitted main [29] ./example.js + [3] (webpack)/~/react/lib/reactProdInvariant.js 1.27 kB {12} [built] + [12] (webpack)/~/react/lib/canDefineProperty.js 632 bytes {12} [built] + [13] (webpack)/~/react/lib/getIteratorFn.js 1.15 kB {12} [built] + [22] (webpack)/~/react/lib/ReactPropTypes.js 13.7 kB {12} [built] + [23] (webpack)/~/react/lib/ReactVersion.js 382 bytes {12} [built] + [28] (webpack)/~/react/lib/onlyChild.js 1.36 kB {12} [built] +chunk {13} c3adbf94e7e39acf7373.js 33.1 kB [initial] [rendered] + > aggressive-splitted main [29] ./example.js + [19] (webpack)/~/react/lib/traverseAllChildren.js 6.38 kB {13} [built] + [21] (webpack)/~/react/lib/ReactClass.js 26.7 kB {13} [built] + [29] ./example.js 44 bytes {13} [built] +``` + +## Minimized (uglify-js, no zip) + +``` +Hash: db9e88642ccb12a1264f +Version: webpack 2.1.0-beta.15 +Time: 2561ms + Asset Size Chunks Chunk Names +8fcb4106a762189b462e.js 11.2 kB 7 [emitted] +42f9c68ce2db0b310159.js 10.4 kB 0 [emitted] +c24df64c9d1be3f14bed.js 10.5 kB 2 [emitted] +c9045e231c8edbc788ae.js 14.2 kB 3 [emitted] +cbb6123321cf7cb9fde9.js 10.5 kB 4 [emitted] +a2919251072756ed702d.js 13.7 kB 5 [emitted] +71a18b9485bf6fa9a2d0.js 12.4 kB 6 [emitted] +195c9326275620b0e9c2.js 7.44 kB 1 [emitted] +9ae8368950c8db526738.js 7.79 kB 8 [emitted] +d360e87fdf3111b702b6.js 12.9 kB 9 [emitted] +cc545b839be6a4ff018f.js 10.8 kB 10 [emitted] +ae79591633a901193537.js 11.4 kB 11 [emitted] +754fd6b76d55855b537f.js 5.01 kB 12 [emitted] +c3adbf94e7e39acf7373.js 4.68 kB 13 [emitted] +Entrypoint main = ae79591633a901193537.js 754fd6b76d55855b537f.js c3adbf94e7e39acf7373.js +chunk {0} 42f9c68ce2db0b310159.js 49.9 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [25] (webpack)/~/react-dom/index.js 63 bytes {0} [built] + [31] (webpack)/~/fbjs/lib/ExecutionEnvironment.js 1.06 kB {0} [built] + [64] (webpack)/~/fbjs/lib/EventListener.js 2.67 kB {0} [built] + [65] (webpack)/~/fbjs/lib/focusNode.js 704 bytes {0} [built] + [66] (webpack)/~/fbjs/lib/getActiveElement.js 895 bytes {0} [built] + [67] (webpack)/~/fbjs/lib/shallowEqual.js 1.66 kB {0} [built] + [68] (webpack)/~/react/lib/CSSProperty.js 3.69 kB {0} [built] + [72] (webpack)/~/react/lib/ReactDOMComponentFlags.js 471 bytes {0} [built] + [89] (webpack)/~/fbjs/lib/camelize.js 708 bytes {0} [built] + [90] (webpack)/~/fbjs/lib/camelizeStyleName.js 1 kB {0} [built] + [91] (webpack)/~/fbjs/lib/containsNode.js 1.05 kB {0} [built] + [92] (webpack)/~/fbjs/lib/createArrayFromMixed.js 4.11 kB {0} [built] + [93] (webpack)/~/fbjs/lib/createNodesFromMarkup.js 2.66 kB {0} [built] + [94] (webpack)/~/fbjs/lib/getMarkupWrap.js 3.04 kB {0} [built] + [95] (webpack)/~/fbjs/lib/getUnboundedScrollPosition.js 1.05 kB {0} [built] + [96] (webpack)/~/fbjs/lib/hyphenate.js 800 bytes {0} [built] + [97] (webpack)/~/fbjs/lib/hyphenateStyleName.js 974 bytes {0} [built] + [98] (webpack)/~/fbjs/lib/isNode.js 693 bytes {0} [built] + [99] (webpack)/~/fbjs/lib/isTextNode.js 605 bytes {0} [built] + [100] (webpack)/~/fbjs/lib/memoizeStringOnly.js 698 bytes {0} [built] + [101] (webpack)/~/react/lib/AutoFocusUtils.js 633 bytes {0} [built] + [102] (webpack)/~/react/lib/BeforeInputEventPlugin.js 13.9 kB {0} [built] + [103] (webpack)/~/react/lib/CSSPropertyOperations.js 6.85 kB {0} [built] +chunk {1} 195c9326275620b0e9c2.js 49.2 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [47] (webpack)/~/react/lib/escapeTextContentForBrowser.js 3.48 kB {1} [built] + [48] (webpack)/~/react/lib/setInnerHTML.js 3.91 kB {1} [built] + [58] (webpack)/~/react/lib/getEventCharCode.js 1.54 kB {1} [built] + [59] (webpack)/~/react/lib/getEventModifierState.js 1.27 kB {1} [built] + [60] (webpack)/~/react/lib/getEventTarget.js 1.04 kB {1} [built] + [61] (webpack)/~/react/lib/isEventSupported.js 1.97 kB {1} [built] + [62] (webpack)/~/react/lib/shouldUpdateReactComponent.js 1.45 kB {1} [built] + [63] (webpack)/~/react/lib/validateDOMNesting.js 13.1 kB {1} [built] + [83] (webpack)/~/react/lib/forEachAccumulated.js 893 bytes {1} [built] + [84] (webpack)/~/react/lib/getHostComponentFromComposite.js 789 bytes {1} [built] + [85] (webpack)/~/react/lib/getTextContentAccessor.js 997 bytes {1} [built] + [86] (webpack)/~/react/lib/instantiateReactComponent.js 5.68 kB {1} [built] + [87] (webpack)/~/react/lib/isTextInputElement.js 1.08 kB {1} [built] + [88] (webpack)/~/react/lib/setTextContent.js 1.4 kB {1} [built] + [155] (webpack)/~/react/lib/flattenChildren.js 2.31 kB {1} [built] + [156] (webpack)/~/react/lib/getEventKey.js 2.9 kB {1} [built] + [157] (webpack)/~/react/lib/getNodeForCharacterOffset.js 1.66 kB {1} [built] + [158] (webpack)/~/react/lib/getVendorPrefixedEventName.js 2.92 kB {1} [built] + [159] (webpack)/~/react/lib/quoteAttributeValueForBrowser.js 749 bytes {1} [built] +chunk {2} c24df64c9d1be3f14bed.js 49.7 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [41] (webpack)/~/react/lib/ReactInstanceMap.js 1.26 kB {2} [built] + [55] (webpack)/~/react/lib/ReactErrorUtils.js 2.26 kB {2} [built] + [75] (webpack)/~/react/lib/ReactFeatureFlags.js 665 bytes {2} [built] + [76] (webpack)/~/react/lib/ReactHostComponent.js 2.42 kB {2} [built] + [77] (webpack)/~/react/lib/ReactInputSelection.js 4.31 kB {2} [built] + [79] (webpack)/~/react/lib/ReactMultiChildUpdateTypes.js 864 bytes {2} [built] + [80] (webpack)/~/react/lib/ReactNodeTypes.js 1.06 kB {2} [built] + [124] (webpack)/~/react/lib/ReactDOMTextarea.js 6.36 kB {2} [built] + [126] (webpack)/~/react/lib/ReactDefaultBatchingStrategy.js 1.92 kB {2} [built] + [127] (webpack)/~/react/lib/ReactDefaultInjection.js 3.4 kB {2} [built] + [129] (webpack)/~/react/lib/ReactEventListener.js 5.38 kB {2} [built] + [130] (webpack)/~/react/lib/ReactInjection.js 1.31 kB {2} [built] + [131] (webpack)/~/react/lib/ReactMarkupChecksum.js 1.51 kB {2} [built] + [132] (webpack)/~/react/lib/ReactMultiChild.js 14.6 kB {2} [built] + [135] (webpack)/~/react/lib/ReactRef.js 2.35 kB {2} [built] +chunk {3} c9045e231c8edbc788ae.js 49.8 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [42] (webpack)/~/react/lib/SyntheticUIEvent.js 1.61 kB {3} [built] + [43] (webpack)/~/react/lib/Transaction.js 9.61 kB {3} [built] + [46] (webpack)/~/react/lib/SyntheticMouseEvent.js 2.18 kB {3} [built] + [57] (webpack)/~/react/lib/createMicrosoftUnsafeLocalFunction.js 864 bytes {3} [built] + [82] (webpack)/~/react/lib/accumulateInto.js 1.73 kB {3} [built] + [140] (webpack)/~/react/lib/SimpleEventPlugin.js 18.8 kB {3} [built] + [148] (webpack)/~/react/lib/SyntheticTouchEvent.js 1.32 kB {3} [built] + [149] (webpack)/~/react/lib/SyntheticTransitionEvent.js 1.27 kB {3} [built] + [150] (webpack)/~/react/lib/SyntheticWheelEvent.js 1.98 kB {3} [built] + [151] (webpack)/~/react/lib/adler32.js 1.22 kB {3} [built] + [152] (webpack)/~/react/lib/checkReactTypeSpec.js 3.68 kB {3} [built] + [153] (webpack)/~/react/lib/dangerousStyleValue.js 3.06 kB {3} [built] + [154] (webpack)/~/react/lib/findDOMNode.js 2.49 kB {3} [built] +chunk {4} cbb6123321cf7cb9fde9.js 50 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [30] (webpack)/~/react/lib/ReactDOMComponentTree.js 6.2 kB {4} [built] + [32] (webpack)/~/react/lib/ReactInstrumentation.js 559 bytes {4} [built] + [45] (webpack)/~/react/lib/ReactBrowserEventEmitter.js 12.5 kB {4} [built] + [74] (webpack)/~/react/lib/ReactEmptyComponent.js 743 bytes {4} [built] + [110] (webpack)/~/react/lib/ReactChildReconciler.js 5.2 kB {4} [built] + [112] (webpack)/~/react/lib/ReactDOM.js 4.66 kB {4} [built] + [115] (webpack)/~/react/lib/ReactDOMContainerInfo.js 1.01 kB {4} [built] + [116] (webpack)/~/react/lib/ReactDOMEmptyComponent.js 1.95 kB {4} [built] + [117] (webpack)/~/react/lib/ReactDOMFeatureFlags.js 460 bytes {4} [built] + [118] (webpack)/~/react/lib/ReactDOMIDOperations.js 996 bytes {4} [built] + [119] (webpack)/~/react/lib/ReactDOMInput.js 11.4 kB {4} [built] + [120] (webpack)/~/react/lib/ReactDOMInstrumentation.js 571 bytes {4} [built] + [121] (webpack)/~/react/lib/ReactDOMOption.js 3.73 kB {4} [built] +chunk {5} a2919251072756ed702d.js 49.6 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [33] (webpack)/~/react/lib/ReactUpdates.js 9.6 kB {5} [built] + [35] (webpack)/~/react/lib/SyntheticEvent.js 8.73 kB {5} [built] + [56] (webpack)/~/react/lib/ReactUpdateQueue.js 8.97 kB {5} [built] + [138] (webpack)/~/react/lib/SVGDOMPropertyConfig.js 7.32 kB {5} [built] + [139] (webpack)/~/react/lib/SelectEventPlugin.js 6.49 kB {5} [built] + [142] (webpack)/~/react/lib/SyntheticClipboardEvent.js 1.21 kB {5} [built] + [143] (webpack)/~/react/lib/SyntheticCompositionEvent.js 1.14 kB {5} [built] + [144] (webpack)/~/react/lib/SyntheticDragEvent.js 1.11 kB {5} [built] + [145] (webpack)/~/react/lib/SyntheticFocusEvent.js 1.1 kB {5} [built] + [146] (webpack)/~/react/lib/SyntheticInputEvent.js 1.13 kB {5} [built] + [147] (webpack)/~/react/lib/SyntheticKeyboardEvent.js 2.75 kB {5} [built] +chunk {6} 71a18b9485bf6fa9a2d0.js 49.8 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [34] (webpack)/~/react/lib/EventConstants.js 2.17 kB {6} [built] + [39] (webpack)/~/react/lib/EventPluginHub.js 8.06 kB {6} [built] + [40] (webpack)/~/react/lib/EventPropagators.js 5.32 kB {6} [built] + [51] (webpack)/~/react/lib/EventPluginRegistry.js 9.48 kB {6} [built] + [52] (webpack)/~/react/lib/EventPluginUtils.js 8.17 kB {6} [built] + [53] (webpack)/~/react/lib/LinkedValueUtils.js 5.19 kB {6} [built] + [54] (webpack)/~/react/lib/ReactComponentEnvironment.js 1.72 kB {6} [built] + [71] (webpack)/~/react/lib/ReactComponentBrowserEnvironment.js 1.24 kB {6} [built] + [108] (webpack)/~/react/lib/FallbackCompositionState.js 2.47 kB {6} [built] + [109] (webpack)/~/react/lib/HTMLDOMPropertyConfig.js 5.35 kB {6} [built] + [113] (webpack)/~/react/lib/ReactDOMButton.js 634 bytes {6} [built] +chunk {7} 8fcb4106a762189b462e.js 49.9 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [36] (webpack)/~/react/lib/DOMLazyTree.js 3.75 kB {7} [built] + [37] (webpack)/~/react/lib/DOMProperty.js 8.13 kB {7} [built] + [44] (webpack)/~/react/lib/DisabledInputUtils.js 1.16 kB {7} [built] + [49] (webpack)/~/react/lib/DOMChildrenOperations.js 7.3 kB {7} [built] + [50] (webpack)/~/react/lib/DOMNamespaces.js 538 bytes {7} [built] + [69] (webpack)/~/react/lib/CallbackQueue.js 2.73 kB {7} [built] + [70] (webpack)/~/react/lib/DOMPropertyOperations.js 7.85 kB {7} [built] + [104] (webpack)/~/react/lib/ChangeEventPlugin.js 11.5 kB {7} [built] + [105] (webpack)/~/react/lib/Danger.js 2.27 kB {7} [built] + [106] (webpack)/~/react/lib/DefaultEventPluginOrder.js 1.26 kB {7} [built] + [107] (webpack)/~/react/lib/EnterLeaveEventPlugin.js 3.46 kB {7} [built] +chunk {8} 9ae8368950c8db526738.js 49.8 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [38] (webpack)/~/react/lib/ReactReconciler.js 7.11 kB {8} [built] + [78] (webpack)/~/react/lib/ReactMount.js 24.6 kB {8} [built] + [81] (webpack)/~/react/lib/ViewportMetrics.js 641 bytes {8} [built] + [133] (webpack)/~/react/lib/ReactOwner.js 3.6 kB {8} [built] + [134] (webpack)/~/react/lib/ReactReconcileTransaction.js 5.31 kB {8} [built] + [136] (webpack)/~/react/lib/ReactServerRenderingTransaction.js 2.35 kB {8} [built] + [137] (webpack)/~/react/lib/ReactServerUpdateQueue.js 4.95 kB {8} [built] + [141] (webpack)/~/react/lib/SyntheticAnimationEvent.js 1.25 kB {8} [built] +chunk {9} d360e87fdf3111b702b6.js 49.8 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [114] (webpack)/~/react/lib/ReactDOMComponent.js 38.9 kB {9} [built] + [123] (webpack)/~/react/lib/ReactDOMTextComponent.js 6.14 kB {9} [built] + [125] (webpack)/~/react/lib/ReactDOMTreeTraversal.js 3.74 kB {9} [built] + [128] (webpack)/~/react/lib/ReactEventEmitterMixin.js 1 kB {9} [built] +chunk {10} cc545b839be6a4ff018f.js 49.9 kB {13} {11} {12} [rendered] [recorded] + > aggressive-splitted [29] ./example.js 2:0-22 + [73] (webpack)/~/react/lib/ReactDOMSelect.js 6.9 kB {10} [built] + [111] (webpack)/~/react/lib/ReactCompositeComponent.js 35.7 kB {10} [built] + [122] (webpack)/~/react/lib/ReactDOMSelection.js 6.81 kB {10} [built] + [160] (webpack)/~/react/lib/renderSubtreeIntoContainer.js 466 bytes {10} [built] +chunk {11} ae79591633a901193537.js 49.8 kB [entry] [rendered] [recorded] + > aggressive-splitted main [29] ./example.js + [0] (webpack)/~/react/lib/ReactElement.js 12.2 kB {11} [built] + [1] (webpack)/~/fbjs/lib/invariant.js 1.49 kB {11} [built] + [2] (webpack)/~/fbjs/lib/warning.js 1.75 kB {11} [built] + [4] (webpack)/~/object-assign/index.js 1.99 kB {11} [built] + [5] (webpack)/~/fbjs/lib/emptyFunction.js 1.08 kB {11} [built] + [6] (webpack)/~/react/lib/ReactCurrentOwner.js 657 bytes {11} [built] + [7] (webpack)/~/fbjs/lib/emptyObject.js 458 bytes {11} [built] + [8] (webpack)/~/fbjs/lib/keyMirror.js 1.25 kB {11} [built] + [9] (webpack)/~/react/lib/ReactPropTypeLocationNames.js 614 bytes {11} [built] + [10] (webpack)/~/react/lib/ReactComponent.js 4.64 kB {11} [built] + [11] (webpack)/~/react/lib/ReactNoopUpdateQueue.js 3.4 kB {11} [built] + [14] (webpack)/~/react/react.js 56 bytes {11} [built] + [15] (webpack)/~/fbjs/lib/keyOf.js 1.1 kB {11} [built] + [16] (webpack)/~/react/lib/PooledClass.js 3.59 kB {11} [built] + [17] (webpack)/~/react/lib/KeyEscapeUtils.js 1.33 kB {11} [built] + [18] (webpack)/~/react/lib/ReactPropTypeLocations.js 552 bytes {11} [built] + [20] (webpack)/~/react/lib/ReactChildren.js 6.22 kB {11} [built] + [24] (webpack)/~/fbjs/lib/mapObject.js 1.44 kB {11} [built] + [26] (webpack)/~/react/lib/React.js 2.62 kB {11} [built] + [27] (webpack)/~/react/lib/ReactDOMFactories.js 3.34 kB {11} [built] +chunk {12} 754fd6b76d55855b537f.js 18.5 kB [initial] [rendered] + > aggressive-splitted main [29] ./example.js + [3] (webpack)/~/react/lib/reactProdInvariant.js 1.27 kB {12} [built] + [12] (webpack)/~/react/lib/canDefineProperty.js 632 bytes {12} [built] + [13] (webpack)/~/react/lib/getIteratorFn.js 1.15 kB {12} [built] + [22] (webpack)/~/react/lib/ReactPropTypes.js 13.7 kB {12} [built] + [23] (webpack)/~/react/lib/ReactVersion.js 382 bytes {12} [built] + [28] (webpack)/~/react/lib/onlyChild.js 1.36 kB {12} [built] +chunk {13} c3adbf94e7e39acf7373.js 33.1 kB [initial] [rendered] + > aggressive-splitted main [29] ./example.js + [19] (webpack)/~/react/lib/traverseAllChildren.js 6.38 kB {13} [built] + [21] (webpack)/~/react/lib/ReactClass.js 26.7 kB {13} [built] + [29] ./example.js 44 bytes {13} [built] +``` + +## Records + +``` +{ + "nextFreeModuleId": 161, + "modules": { + "byIdentifier": { + "..\\..\\node_modules\\react\\lib\\ReactElement.js": 0, + "..\\..\\node_modules\\fbjs\\lib\\invariant.js": 1, + "..\\..\\node_modules\\fbjs\\lib\\warning.js": 2, + "..\\..\\node_modules\\react\\lib\\reactProdInvariant.js": 3, + "..\\..\\node_modules\\object-assign\\index.js": 4, + "..\\..\\node_modules\\fbjs\\lib\\emptyFunction.js": 5, + "..\\..\\node_modules\\react\\lib\\ReactCurrentOwner.js": 6, + "..\\..\\node_modules\\fbjs\\lib\\emptyObject.js": 7, + "..\\..\\node_modules\\fbjs\\lib\\keyMirror.js": 8, + "..\\..\\node_modules\\react\\lib\\ReactPropTypeLocationNames.js": 9, + "..\\..\\node_modules\\react\\lib\\ReactComponent.js": 10, + "..\\..\\node_modules\\react\\lib\\ReactNoopUpdateQueue.js": 11, + "..\\..\\node_modules\\react\\lib\\canDefineProperty.js": 12, + "..\\..\\node_modules\\react\\lib\\getIteratorFn.js": 13, + "..\\..\\node_modules\\react\\react.js": 14, + "..\\..\\node_modules\\fbjs\\lib\\keyOf.js": 15, + "..\\..\\node_modules\\react\\lib\\PooledClass.js": 16, + "..\\..\\node_modules\\react\\lib\\KeyEscapeUtils.js": 17, + "..\\..\\node_modules\\react\\lib\\ReactPropTypeLocations.js": 18, + "..\\..\\node_modules\\react\\lib\\traverseAllChildren.js": 19, + "..\\..\\node_modules\\react\\lib\\ReactChildren.js": 20, + "..\\..\\node_modules\\react\\lib\\ReactClass.js": 21, + "..\\..\\node_modules\\react\\lib\\ReactPropTypes.js": 22, + "..\\..\\node_modules\\react\\lib\\ReactVersion.js": 23, + "..\\..\\node_modules\\fbjs\\lib\\mapObject.js": 24, + "..\\..\\node_modules\\react-dom\\index.js": 25, + "..\\..\\node_modules\\react\\lib\\React.js": 26, + "..\\..\\node_modules\\react\\lib\\ReactDOMFactories.js": 27, + "..\\..\\node_modules\\react\\lib\\onlyChild.js": 28, + "example.js": 29, + "..\\..\\node_modules\\react\\lib\\ReactDOMComponentTree.js": 30, + "..\\..\\node_modules\\fbjs\\lib\\ExecutionEnvironment.js": 31, + "..\\..\\node_modules\\react\\lib\\ReactInstrumentation.js": 32, + "..\\..\\node_modules\\react\\lib\\ReactUpdates.js": 33, + "..\\..\\node_modules\\react\\lib\\EventConstants.js": 34, + "..\\..\\node_modules\\react\\lib\\SyntheticEvent.js": 35, + "..\\..\\node_modules\\react\\lib\\DOMLazyTree.js": 36, + "..\\..\\node_modules\\react\\lib\\DOMProperty.js": 37, + "..\\..\\node_modules\\react\\lib\\ReactReconciler.js": 38, + "..\\..\\node_modules\\react\\lib\\EventPluginHub.js": 39, + "..\\..\\node_modules\\react\\lib\\EventPropagators.js": 40, + "..\\..\\node_modules\\react\\lib\\ReactInstanceMap.js": 41, + "..\\..\\node_modules\\react\\lib\\SyntheticUIEvent.js": 42, + "..\\..\\node_modules\\react\\lib\\Transaction.js": 43, + "..\\..\\node_modules\\react\\lib\\DisabledInputUtils.js": 44, + "..\\..\\node_modules\\react\\lib\\ReactBrowserEventEmitter.js": 45, + "..\\..\\node_modules\\react\\lib\\SyntheticMouseEvent.js": 46, + "..\\..\\node_modules\\react\\lib\\escapeTextContentForBrowser.js": 47, + "..\\..\\node_modules\\react\\lib\\setInnerHTML.js": 48, + "..\\..\\node_modules\\react\\lib\\DOMChildrenOperations.js": 49, + "..\\..\\node_modules\\react\\lib\\DOMNamespaces.js": 50, + "..\\..\\node_modules\\react\\lib\\EventPluginRegistry.js": 51, + "..\\..\\node_modules\\react\\lib\\EventPluginUtils.js": 52, + "..\\..\\node_modules\\react\\lib\\LinkedValueUtils.js": 53, + "..\\..\\node_modules\\react\\lib\\ReactComponentEnvironment.js": 54, + "..\\..\\node_modules\\react\\lib\\ReactErrorUtils.js": 55, + "..\\..\\node_modules\\react\\lib\\ReactUpdateQueue.js": 56, + "..\\..\\node_modules\\react\\lib\\createMicrosoftUnsafeLocalFunction.js": 57, + "..\\..\\node_modules\\react\\lib\\getEventCharCode.js": 58, + "..\\..\\node_modules\\react\\lib\\getEventModifierState.js": 59, + "..\\..\\node_modules\\react\\lib\\getEventTarget.js": 60, + "..\\..\\node_modules\\react\\lib\\isEventSupported.js": 61, + "..\\..\\node_modules\\react\\lib\\shouldUpdateReactComponent.js": 62, + "..\\..\\node_modules\\react\\lib\\validateDOMNesting.js": 63, + "..\\..\\node_modules\\fbjs\\lib\\EventListener.js": 64, + "..\\..\\node_modules\\fbjs\\lib\\focusNode.js": 65, + "..\\..\\node_modules\\fbjs\\lib\\getActiveElement.js": 66, + "..\\..\\node_modules\\fbjs\\lib\\shallowEqual.js": 67, + "..\\..\\node_modules\\react\\lib\\CSSProperty.js": 68, + "..\\..\\node_modules\\react\\lib\\CallbackQueue.js": 69, + "..\\..\\node_modules\\react\\lib\\DOMPropertyOperations.js": 70, + "..\\..\\node_modules\\react\\lib\\ReactComponentBrowserEnvironment.js": 71, + "..\\..\\node_modules\\react\\lib\\ReactDOMComponentFlags.js": 72, + "..\\..\\node_modules\\react\\lib\\ReactDOMSelect.js": 73, + "..\\..\\node_modules\\react\\lib\\ReactEmptyComponent.js": 74, + "..\\..\\node_modules\\react\\lib\\ReactFeatureFlags.js": 75, + "..\\..\\node_modules\\react\\lib\\ReactHostComponent.js": 76, + "..\\..\\node_modules\\react\\lib\\ReactInputSelection.js": 77, + "..\\..\\node_modules\\react\\lib\\ReactMount.js": 78, + "..\\..\\node_modules\\react\\lib\\ReactMultiChildUpdateTypes.js": 79, + "..\\..\\node_modules\\react\\lib\\ReactNodeTypes.js": 80, + "..\\..\\node_modules\\react\\lib\\ViewportMetrics.js": 81, + "..\\..\\node_modules\\react\\lib\\accumulateInto.js": 82, + "..\\..\\node_modules\\react\\lib\\forEachAccumulated.js": 83, + "..\\..\\node_modules\\react\\lib\\getHostComponentFromComposite.js": 84, + "..\\..\\node_modules\\react\\lib\\getTextContentAccessor.js": 85, + "..\\..\\node_modules\\react\\lib\\instantiateReactComponent.js": 86, + "..\\..\\node_modules\\react\\lib\\isTextInputElement.js": 87, + "..\\..\\node_modules\\react\\lib\\setTextContent.js": 88, + "..\\..\\node_modules\\fbjs\\lib\\camelize.js": 89, + "..\\..\\node_modules\\fbjs\\lib\\camelizeStyleName.js": 90, + "..\\..\\node_modules\\fbjs\\lib\\containsNode.js": 91, + "..\\..\\node_modules\\fbjs\\lib\\createArrayFromMixed.js": 92, + "..\\..\\node_modules\\fbjs\\lib\\createNodesFromMarkup.js": 93, + "..\\..\\node_modules\\fbjs\\lib\\getMarkupWrap.js": 94, + "..\\..\\node_modules\\fbjs\\lib\\getUnboundedScrollPosition.js": 95, + "..\\..\\node_modules\\fbjs\\lib\\hyphenate.js": 96, + "..\\..\\node_modules\\fbjs\\lib\\hyphenateStyleName.js": 97, + "..\\..\\node_modules\\fbjs\\lib\\isNode.js": 98, + "..\\..\\node_modules\\fbjs\\lib\\isTextNode.js": 99, + "..\\..\\node_modules\\fbjs\\lib\\memoizeStringOnly.js": 100, + "..\\..\\node_modules\\react\\lib\\AutoFocusUtils.js": 101, + "..\\..\\node_modules\\react\\lib\\BeforeInputEventPlugin.js": 102, + "..\\..\\node_modules\\react\\lib\\CSSPropertyOperations.js": 103, + "..\\..\\node_modules\\react\\lib\\ChangeEventPlugin.js": 104, + "..\\..\\node_modules\\react\\lib\\Danger.js": 105, + "..\\..\\node_modules\\react\\lib\\DefaultEventPluginOrder.js": 106, + "..\\..\\node_modules\\react\\lib\\EnterLeaveEventPlugin.js": 107, + "..\\..\\node_modules\\react\\lib\\FallbackCompositionState.js": 108, + "..\\..\\node_modules\\react\\lib\\HTMLDOMPropertyConfig.js": 109, + "..\\..\\node_modules\\react\\lib\\ReactChildReconciler.js": 110, + "..\\..\\node_modules\\react\\lib\\ReactCompositeComponent.js": 111, + "..\\..\\node_modules\\react\\lib\\ReactDOM.js": 112, + "..\\..\\node_modules\\react\\lib\\ReactDOMButton.js": 113, + "..\\..\\node_modules\\react\\lib\\ReactDOMComponent.js": 114, + "..\\..\\node_modules\\react\\lib\\ReactDOMContainerInfo.js": 115, + "..\\..\\node_modules\\react\\lib\\ReactDOMEmptyComponent.js": 116, + "..\\..\\node_modules\\react\\lib\\ReactDOMFeatureFlags.js": 117, + "..\\..\\node_modules\\react\\lib\\ReactDOMIDOperations.js": 118, + "..\\..\\node_modules\\react\\lib\\ReactDOMInput.js": 119, + "..\\..\\node_modules\\react\\lib\\ReactDOMInstrumentation.js": 120, + "..\\..\\node_modules\\react\\lib\\ReactDOMOption.js": 121, + "..\\..\\node_modules\\react\\lib\\ReactDOMSelection.js": 122, + "..\\..\\node_modules\\react\\lib\\ReactDOMTextComponent.js": 123, + "..\\..\\node_modules\\react\\lib\\ReactDOMTextarea.js": 124, + "..\\..\\node_modules\\react\\lib\\ReactDOMTreeTraversal.js": 125, + "..\\..\\node_modules\\react\\lib\\ReactDefaultBatchingStrategy.js": 126, + "..\\..\\node_modules\\react\\lib\\ReactDefaultInjection.js": 127, + "..\\..\\node_modules\\react\\lib\\ReactEventEmitterMixin.js": 128, + "..\\..\\node_modules\\react\\lib\\ReactEventListener.js": 129, + "..\\..\\node_modules\\react\\lib\\ReactInjection.js": 130, + "..\\..\\node_modules\\react\\lib\\ReactMarkupChecksum.js": 131, + "..\\..\\node_modules\\react\\lib\\ReactMultiChild.js": 132, + "..\\..\\node_modules\\react\\lib\\ReactOwner.js": 133, + "..\\..\\node_modules\\react\\lib\\ReactReconcileTransaction.js": 134, + "..\\..\\node_modules\\react\\lib\\ReactRef.js": 135, + "..\\..\\node_modules\\react\\lib\\ReactServerRenderingTransaction.js": 136, + "..\\..\\node_modules\\react\\lib\\ReactServerUpdateQueue.js": 137, + "..\\..\\node_modules\\react\\lib\\SVGDOMPropertyConfig.js": 138, + "..\\..\\node_modules\\react\\lib\\SelectEventPlugin.js": 139, + "..\\..\\node_modules\\react\\lib\\SimpleEventPlugin.js": 140, + "..\\..\\node_modules\\react\\lib\\SyntheticAnimationEvent.js": 141, + "..\\..\\node_modules\\react\\lib\\SyntheticClipboardEvent.js": 142, + "..\\..\\node_modules\\react\\lib\\SyntheticCompositionEvent.js": 143, + "..\\..\\node_modules\\react\\lib\\SyntheticDragEvent.js": 144, + "..\\..\\node_modules\\react\\lib\\SyntheticFocusEvent.js": 145, + "..\\..\\node_modules\\react\\lib\\SyntheticInputEvent.js": 146, + "..\\..\\node_modules\\react\\lib\\SyntheticKeyboardEvent.js": 147, + "..\\..\\node_modules\\react\\lib\\SyntheticTouchEvent.js": 148, + "..\\..\\node_modules\\react\\lib\\SyntheticTransitionEvent.js": 149, + "..\\..\\node_modules\\react\\lib\\SyntheticWheelEvent.js": 150, + "..\\..\\node_modules\\react\\lib\\adler32.js": 151, + "..\\..\\node_modules\\react\\lib\\checkReactTypeSpec.js": 152, + "..\\..\\node_modules\\react\\lib\\dangerousStyleValue.js": 153, + "..\\..\\node_modules\\react\\lib\\findDOMNode.js": 154, + "..\\..\\node_modules\\react\\lib\\flattenChildren.js": 155, + "..\\..\\node_modules\\react\\lib\\getEventKey.js": 156, + "..\\..\\node_modules\\react\\lib\\getNodeForCharacterOffset.js": 157, + "..\\..\\node_modules\\react\\lib\\getVendorPrefixedEventName.js": 158, + "..\\..\\node_modules\\react\\lib\\quoteAttributeValueForBrowser.js": 159, + "..\\..\\node_modules\\react\\lib\\renderSubtreeIntoContainer.js": 160 + } + }, + "nextFreeChunkId": 14, + "chunks": { + "byName": {}, + "byBlocks": { + "example.js:0/0:4": 0, + "example.js:0/0:2": 1, + "example.js:0/0:9": 2, + "example.js:0/0:10": 3, + "example.js:0/0:1": 4, + "example.js:0/0:3": 5, + "example.js:0/0:0": 6, + "example.js:0/0:5": 7, + "example.js:0/0:6": 8, + "example.js:0/0:8": 9, + "example.js:0/0:7": 10 + } + }, + "aggressiveSplits": [ + { + "modules": [ + "..\\..\\node_modules\\fbjs\\lib\\EventListener.js", + "..\\..\\node_modules\\fbjs\\lib\\ExecutionEnvironment.js", + "..\\..\\node_modules\\fbjs\\lib\\camelize.js", + "..\\..\\node_modules\\fbjs\\lib\\camelizeStyleName.js", + "..\\..\\node_modules\\fbjs\\lib\\containsNode.js", + "..\\..\\node_modules\\fbjs\\lib\\createArrayFromMixed.js", + "..\\..\\node_modules\\fbjs\\lib\\createNodesFromMarkup.js", + "..\\..\\node_modules\\fbjs\\lib\\focusNode.js", + "..\\..\\node_modules\\fbjs\\lib\\getActiveElement.js", + "..\\..\\node_modules\\fbjs\\lib\\getMarkupWrap.js", + "..\\..\\node_modules\\fbjs\\lib\\getUnboundedScrollPosition.js", + "..\\..\\node_modules\\fbjs\\lib\\hyphenate.js", + "..\\..\\node_modules\\fbjs\\lib\\hyphenateStyleName.js", + "..\\..\\node_modules\\fbjs\\lib\\isNode.js", + "..\\..\\node_modules\\fbjs\\lib\\isTextNode.js", + "..\\..\\node_modules\\fbjs\\lib\\memoizeStringOnly.js", + "..\\..\\node_modules\\fbjs\\lib\\shallowEqual.js", + "..\\..\\node_modules\\react-dom\\index.js", + "..\\..\\node_modules\\react\\lib\\AutoFocusUtils.js", + "..\\..\\node_modules\\react\\lib\\BeforeInputEventPlugin.js", + "..\\..\\node_modules\\react\\lib\\CSSProperty.js", + "..\\..\\node_modules\\react\\lib\\CSSPropertyOperations.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMComponentFlags.js" + ], + "hash": "42f9c68ce2db0b310159cb3440d73c99", + "id": 0 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\escapeTextContentForBrowser.js", + "..\\..\\node_modules\\react\\lib\\flattenChildren.js", + "..\\..\\node_modules\\react\\lib\\forEachAccumulated.js", + "..\\..\\node_modules\\react\\lib\\getEventCharCode.js", + "..\\..\\node_modules\\react\\lib\\getEventKey.js", + "..\\..\\node_modules\\react\\lib\\getEventModifierState.js", + "..\\..\\node_modules\\react\\lib\\getEventTarget.js", + "..\\..\\node_modules\\react\\lib\\getHostComponentFromComposite.js", + "..\\..\\node_modules\\react\\lib\\getNodeForCharacterOffset.js", + "..\\..\\node_modules\\react\\lib\\getTextContentAccessor.js", + "..\\..\\node_modules\\react\\lib\\getVendorPrefixedEventName.js", + "..\\..\\node_modules\\react\\lib\\instantiateReactComponent.js", + "..\\..\\node_modules\\react\\lib\\isEventSupported.js", + "..\\..\\node_modules\\react\\lib\\isTextInputElement.js", + "..\\..\\node_modules\\react\\lib\\quoteAttributeValueForBrowser.js", + "..\\..\\node_modules\\react\\lib\\setInnerHTML.js", + "..\\..\\node_modules\\react\\lib\\setTextContent.js", + "..\\..\\node_modules\\react\\lib\\shouldUpdateReactComponent.js", + "..\\..\\node_modules\\react\\lib\\validateDOMNesting.js" + ], + "hash": "195c9326275620b0e9c23a860186e769", + "id": 1 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\ReactDOMTextarea.js", + "..\\..\\node_modules\\react\\lib\\ReactDefaultBatchingStrategy.js", + "..\\..\\node_modules\\react\\lib\\ReactDefaultInjection.js", + "..\\..\\node_modules\\react\\lib\\ReactErrorUtils.js", + "..\\..\\node_modules\\react\\lib\\ReactEventListener.js", + "..\\..\\node_modules\\react\\lib\\ReactFeatureFlags.js", + "..\\..\\node_modules\\react\\lib\\ReactHostComponent.js", + "..\\..\\node_modules\\react\\lib\\ReactInjection.js", + "..\\..\\node_modules\\react\\lib\\ReactInputSelection.js", + "..\\..\\node_modules\\react\\lib\\ReactInstanceMap.js", + "..\\..\\node_modules\\react\\lib\\ReactMarkupChecksum.js", + "..\\..\\node_modules\\react\\lib\\ReactMultiChild.js", + "..\\..\\node_modules\\react\\lib\\ReactMultiChildUpdateTypes.js", + "..\\..\\node_modules\\react\\lib\\ReactNodeTypes.js", + "..\\..\\node_modules\\react\\lib\\ReactRef.js" + ], + "hash": "c24df64c9d1be3f14bed73ddf6ddad6f", + "id": 2 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\SimpleEventPlugin.js", + "..\\..\\node_modules\\react\\lib\\SyntheticMouseEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticTouchEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticTransitionEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticUIEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticWheelEvent.js", + "..\\..\\node_modules\\react\\lib\\Transaction.js", + "..\\..\\node_modules\\react\\lib\\accumulateInto.js", + "..\\..\\node_modules\\react\\lib\\adler32.js", + "..\\..\\node_modules\\react\\lib\\checkReactTypeSpec.js", + "..\\..\\node_modules\\react\\lib\\createMicrosoftUnsafeLocalFunction.js", + "..\\..\\node_modules\\react\\lib\\dangerousStyleValue.js", + "..\\..\\node_modules\\react\\lib\\findDOMNode.js" + ], + "hash": "c9045e231c8edbc788ae3d874cdd124f", + "id": 3 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\ReactBrowserEventEmitter.js", + "..\\..\\node_modules\\react\\lib\\ReactChildReconciler.js", + "..\\..\\node_modules\\react\\lib\\ReactDOM.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMComponentTree.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMContainerInfo.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMEmptyComponent.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMFeatureFlags.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMIDOperations.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMInput.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMInstrumentation.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMOption.js", + "..\\..\\node_modules\\react\\lib\\ReactEmptyComponent.js", + "..\\..\\node_modules\\react\\lib\\ReactInstrumentation.js" + ], + "hash": "cbb6123321cf7cb9fde958c5f8d62ae0", + "id": 4 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\ReactUpdateQueue.js", + "..\\..\\node_modules\\react\\lib\\ReactUpdates.js", + "..\\..\\node_modules\\react\\lib\\SVGDOMPropertyConfig.js", + "..\\..\\node_modules\\react\\lib\\SelectEventPlugin.js", + "..\\..\\node_modules\\react\\lib\\SyntheticClipboardEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticCompositionEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticDragEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticFocusEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticInputEvent.js", + "..\\..\\node_modules\\react\\lib\\SyntheticKeyboardEvent.js" + ], + "hash": "a2919251072756ed702d2c82c808f8e7", + "id": 5 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\EventConstants.js", + "..\\..\\node_modules\\react\\lib\\EventPluginHub.js", + "..\\..\\node_modules\\react\\lib\\EventPluginRegistry.js", + "..\\..\\node_modules\\react\\lib\\EventPluginUtils.js", + "..\\..\\node_modules\\react\\lib\\EventPropagators.js", + "..\\..\\node_modules\\react\\lib\\FallbackCompositionState.js", + "..\\..\\node_modules\\react\\lib\\HTMLDOMPropertyConfig.js", + "..\\..\\node_modules\\react\\lib\\LinkedValueUtils.js", + "..\\..\\node_modules\\react\\lib\\ReactComponentBrowserEnvironment.js", + "..\\..\\node_modules\\react\\lib\\ReactComponentEnvironment.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMButton.js" + ], + "hash": "71a18b9485bf6fa9a2d0a481113e6ed1", + "id": 6 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\CallbackQueue.js", + "..\\..\\node_modules\\react\\lib\\ChangeEventPlugin.js", + "..\\..\\node_modules\\react\\lib\\DOMChildrenOperations.js", + "..\\..\\node_modules\\react\\lib\\DOMLazyTree.js", + "..\\..\\node_modules\\react\\lib\\DOMNamespaces.js", + "..\\..\\node_modules\\react\\lib\\DOMProperty.js", + "..\\..\\node_modules\\react\\lib\\DOMPropertyOperations.js", + "..\\..\\node_modules\\react\\lib\\Danger.js", + "..\\..\\node_modules\\react\\lib\\DefaultEventPluginOrder.js", + "..\\..\\node_modules\\react\\lib\\DisabledInputUtils.js", + "..\\..\\node_modules\\react\\lib\\EnterLeaveEventPlugin.js" + ], + "hash": "8fcb4106a762189b462e5c642fa6085b", + "id": 7 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\ReactMount.js", + "..\\..\\node_modules\\react\\lib\\ReactOwner.js", + "..\\..\\node_modules\\react\\lib\\ReactReconcileTransaction.js", + "..\\..\\node_modules\\react\\lib\\ReactReconciler.js", + "..\\..\\node_modules\\react\\lib\\ReactServerRenderingTransaction.js", + "..\\..\\node_modules\\react\\lib\\ReactServerUpdateQueue.js", + "..\\..\\node_modules\\react\\lib\\SyntheticAnimationEvent.js", + "..\\..\\node_modules\\react\\lib\\ViewportMetrics.js" + ], + "hash": "9ae8368950c8db52673871ee3794dfc1", + "id": 8 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\ReactDOMComponent.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMTextComponent.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMTreeTraversal.js", + "..\\..\\node_modules\\react\\lib\\ReactEventEmitterMixin.js" + ], + "hash": "d360e87fdf3111b702b686a22428e843", + "id": 9 + }, + { + "modules": [ + "..\\..\\node_modules\\react\\lib\\ReactCompositeComponent.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMSelect.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMSelection.js", + "..\\..\\node_modules\\react\\lib\\renderSubtreeIntoContainer.js" + ], + "hash": "cc545b839be6a4ff018fafbbe3543f65", + "id": 10 + }, + { + "modules": [ + "..\\..\\node_modules\\fbjs\\lib\\emptyFunction.js", + "..\\..\\node_modules\\fbjs\\lib\\emptyObject.js", + "..\\..\\node_modules\\fbjs\\lib\\invariant.js", + "..\\..\\node_modules\\fbjs\\lib\\keyMirror.js", + "..\\..\\node_modules\\fbjs\\lib\\keyOf.js", + "..\\..\\node_modules\\fbjs\\lib\\mapObject.js", + "..\\..\\node_modules\\fbjs\\lib\\warning.js", + "..\\..\\node_modules\\object-assign\\index.js", + "..\\..\\node_modules\\react\\lib\\KeyEscapeUtils.js", + "..\\..\\node_modules\\react\\lib\\PooledClass.js", + "..\\..\\node_modules\\react\\lib\\React.js", + "..\\..\\node_modules\\react\\lib\\ReactChildren.js", + "..\\..\\node_modules\\react\\lib\\ReactComponent.js", + "..\\..\\node_modules\\react\\lib\\ReactCurrentOwner.js", + "..\\..\\node_modules\\react\\lib\\ReactDOMFactories.js", + "..\\..\\node_modules\\react\\lib\\ReactElement.js", + "..\\..\\node_modules\\react\\lib\\ReactNoopUpdateQueue.js", + "..\\..\\node_modules\\react\\lib\\ReactPropTypeLocationNames.js", + "..\\..\\node_modules\\react\\lib\\ReactPropTypeLocations.js", + "..\\..\\node_modules\\react\\react.js" + ], + "hash": "ae79591633a90119353790ff634e01a5", + "id": 11 + } + ] +} +``` \ No newline at end of file diff --git a/examples/http2-aggressive-splitting/build.js b/examples/http2-aggressive-splitting/build.js new file mode 100644 index 00000000000..6ae2decc566 --- /dev/null +++ b/examples/http2-aggressive-splitting/build.js @@ -0,0 +1,3 @@ +global.NO_TARGET_ARGS = true; +global.NO_REASONS = true; +require("../build-common"); \ No newline at end of file diff --git a/examples/http2-aggressive-splitting/example.js b/examples/http2-aggressive-splitting/example.js new file mode 100644 index 00000000000..11dd6795443 --- /dev/null +++ b/examples/http2-aggressive-splitting/example.js @@ -0,0 +1,2 @@ +require("react"); +require(["react-dom"]); diff --git a/examples/http2-aggressive-splitting/template.md b/examples/http2-aggressive-splitting/template.md new file mode 100644 index 00000000000..75ad6b50553 --- /dev/null +++ b/examples/http2-aggressive-splitting/template.md @@ -0,0 +1,19 @@ +# Info + +## Uncompressed + +``` +{{stdout}} +``` + +## Minimized (uglify-js, no zip) + +``` +{{min:stdout}} +``` + +## Records + +``` +{{js/records.json}} +``` \ No newline at end of file diff --git a/examples/http2-aggressive-splitting/webpack.config.js b/examples/http2-aggressive-splitting/webpack.config.js new file mode 100644 index 00000000000..e875b026f8a --- /dev/null +++ b/examples/http2-aggressive-splitting/webpack.config.js @@ -0,0 +1,20 @@ +var path = require("path"); +var webpack = require("../../"); +module.exports = { + entry: "./example", + output: { + path: path.join(__dirname, "js"), + filename: "[chunkhash].js", + chunkFilename: "[chunkhash].js" + }, + plugins: [ + new webpack.optimize.AggressiveSplittingPlugin({ + minSize: 30000, + maxSize: 50000 + }), + new webpack.DefinePlugin({ + "process.env.NODE_ENV": JSON.stringify("production") + }) + ], + recordsOutputPath: path.join(__dirname, "js", "records.json") +}; diff --git a/lib/AsyncDependenciesBlock.js b/lib/AsyncDependenciesBlock.js index 6d489b8d5ba..4371170d836 100644 --- a/lib/AsyncDependenciesBlock.js +++ b/lib/AsyncDependenciesBlock.js @@ -38,3 +38,25 @@ AsyncDependenciesBlock.prototype.disconnect = function() { this.chunks = null; DependenciesBlock.prototype.disconnect.call(this); }; + +AsyncDependenciesBlock.prototype.unseal = function() { + this.chunks = null; + DependenciesBlock.prototype.unseal.call(this); +}; + +AsyncDependenciesBlock.prototype.sortItems = function() { + DependenciesBlock.prototype.sortItems.call(this); + if(this.chunks) { + this.chunks.sort(function(a, b) { + var i = 0; + while(true) { + if(!a.modules[i] && !b.modules[i]) return 0; + if(!a.modules[i]) return -1; + if(!b.modules[i]) return 1; + if(a.modules[i].id > b.modules[i].id) return 1; + if(a.modules[i].id < b.modules[i].id) return -1; + i++; + } + }); + } +}; diff --git a/lib/Chunk.js b/lib/Chunk.js index 2aac34657a9..9a51bf0c100 100644 --- a/lib/Chunk.js +++ b/lib/Chunk.js @@ -2,6 +2,7 @@ MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ +var compareLocations = require("./compareLocations"); var debugId = 1000; function Chunk(name, module, loc) { @@ -10,14 +11,13 @@ function Chunk(name, module, loc) { this.debugId = debugId++; this.name = name; this.modules = []; + this.entrypoints = []; this.chunks = []; this.parents = []; this.blocks = []; this.origins = []; this.files = []; this.rendered = false; - this.entry = false; - this.initial = false; if(module) { this.origins.push({ module: module, @@ -28,6 +28,39 @@ function Chunk(name, module, loc) { } module.exports = Chunk; +Object.defineProperty(Chunk.prototype, "entry", { + configurable: false, + get: function() { + throw new Error("Chunk.entry was removed. Use hasRuntime()"); + }, + set: function() { + throw new Error("Chunk.entry was removed. Use hasRuntime()"); + } +}); + +Object.defineProperty(Chunk.prototype, "initial", { + configurable: false, + get: function() { + throw new Error("Chunk.initial was removed. Use isInitial()"); + }, + set: function() { + throw new Error("Chunk.initial was removed. Use isInitial()"); + } +}); + +Chunk.prototype.hasRuntime = function() { + if(this.entrypoints.length === 0) return false; + return this.entrypoints[0].chunks[0] === this; +}; + +Chunk.prototype.isInitial = function() { + return this.entrypoints.length > 0; +}; + +Chunk.prototype.hasEntryModule = function() { + return !!this.entryModule; +}; + Chunk.prototype.addModule = function(module) { if(this.modules.indexOf(module) >= 0) { return false; @@ -117,6 +150,13 @@ Chunk.prototype.remove = function(reason) { }, this); }; +Chunk.prototype.moveModule = function(module, other) { + module.removeChunk(this); + module.addChunk(other); + other.addModule(module); + module.rewriteChunkInReasons(this, [other]); +}; + Chunk.prototype.integrate = function(other, reason) { if(!this.canBeIntegrated(other)) { return false; @@ -161,16 +201,37 @@ Chunk.prototype.integrate = function(other, reason) { }, this); other.blocks.length = 0; other.origins.forEach(function(origin) { + this.origins.push(origin); + }, this); + this.origins.forEach(function(origin) { if(!origin.reasons) { origin.reasons = [reason]; } else if(origin.reasons[0] !== reason) { origin.reasons.unshift(reason); } - this.origins.push(origin); - }, this); + }) return true; }; +Chunk.prototype.split = function(newChunk) { + var _this = this; + this.blocks.forEach(function(b) { + newChunk.blocks.push(b); + b.chunks.push(newChunk); + }); + this.chunks.forEach(function(c) { + newChunk.chunks.push(c); + c.parents.push(newChunk); + }); + this.parents.forEach(function(p) { + p.chunks.push(newChunk); + newChunk.parents.push(p); + }); + this.entrypoints.forEach(function(e) { + e.insertChunk(newChunk, _this); + }); +}; + Chunk.prototype.isEmpty = function() { return this.modules.length === 0; }; @@ -178,27 +239,27 @@ Chunk.prototype.isEmpty = function() { Chunk.prototype.updateHash = function(hash) { hash.update(this.id + " "); hash.update(this.ids ? this.ids.join(",") : ""); - hash.update(this.name + ""); + hash.update((this.name || "") + " "); this.modules.forEach(function(m) { m.updateHash(hash); }); }; Chunk.prototype.size = function(options) { - var CHUNK_OVERHEAD = options.chunkOverhead || 10000; + var CHUNK_OVERHEAD = typeof options.chunkOverhead === "number" ? options.chunkOverhead : 10000; var ENTRY_CHUNK_MULTIPLICATOR = options.entryChunkMultiplicator || 10; var modulesSize = this.modules.reduce(function(a, b) { return a + b.size(); }, 0); - return modulesSize * (this.initial ? ENTRY_CHUNK_MULTIPLICATOR : 1) + CHUNK_OVERHEAD; + return modulesSize * (this.isInitial() ? ENTRY_CHUNK_MULTIPLICATOR : 1) + CHUNK_OVERHEAD; }; Chunk.prototype.canBeIntegrated = function(other) { - if(other.initial) { + if(other.isInitial()) { return false; } - if(this.initial) { + if(this.isInitial()) { if(other.parents.length !== 1 || other.parents[0] !== this) { return false; } @@ -225,15 +286,9 @@ Chunk.prototype.integratedSize = function(other, options) { var modulesSize = mergedModules.reduce(function(a, m) { return a + m.size(); }, 0); - return modulesSize * (this.initial || other.initial ? ENTRY_CHUNK_MULTIPLICATOR : 1) + CHUNK_OVERHEAD; + return modulesSize * (this.isInitial() || other.isInitial() ? ENTRY_CHUNK_MULTIPLICATOR : 1) + CHUNK_OVERHEAD; }; -Chunk.prototype.hasEntryModule = function() { - return this.modules.some(function(module) { - return module.entry; - }); -} - Chunk.prototype.getChunkMaps = function(includeEntries, realHash) { var chunksProcessed = []; var chunkHashMap = {}; @@ -241,7 +296,7 @@ Chunk.prototype.getChunkMaps = function(includeEntries, realHash) { (function addChunk(c) { if(chunksProcessed.indexOf(c) >= 0) return; chunksProcessed.push(c); - if(!c.entry || includeEntries) { + if(!c.hasRuntime() || includeEntries) { chunkHashMap[c.id] = realHash ? c.hash : c.renderedHash; if(c.name) chunkNameMap[c.id] = c.name; @@ -254,6 +309,25 @@ Chunk.prototype.getChunkMaps = function(includeEntries, realHash) { }; }; +function byId(a, b) { + return a.id - b.id; +} + +Chunk.prototype.sortItems = function() { + this.modules.sort(byId); + this.origins.sort(function(a, b) { + var aIdent = a.module.identifier(); + var bIdent = b.module.identifier(); + if(aIdent < bIdent) return -1; + if(aIdent > bIdent) return 1; + return compareLocations(a.loc, b.loc); + }); + this.origins.forEach(function(origin) { + if(origin.reasons) + origin.reasons.sort(); + }); +}; + Chunk.prototype.toString = function() { return "Chunk[" + this.modules.join() + "]"; }; diff --git a/lib/Compilation.js b/lib/Compilation.js index 7c24f0a6d3b..2812662dd10 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -11,6 +11,7 @@ var ModuleDependencyWarning = require("./ModuleDependencyWarning"); var Module = require("./Module"); var ArrayMap = require("./ArrayMap"); var Chunk = require("./Chunk"); +var Entrypoint = require("./Entrypoint"); var Stats = require("./Stats"); var MainTemplate = require("./MainTemplate"); var ChunkTemplate = require("./ChunkTemplate"); @@ -38,6 +39,7 @@ function Compilation(compiler) { this.entries = []; this.preparedChunks = []; + this.entrypoints = {}; this.chunks = []; this.namedChunks = {}; this.modules = []; @@ -417,7 +419,6 @@ Compilation.prototype.addEntry = function process(context, entry, name, callback entry.module = module; this.entries.push(module); module.issuer = null; - module.entry = true; }.bind(this), function(err, module) { if(err) { @@ -480,21 +481,45 @@ Compilation.prototype.rebuildModule = function(module, thisCallback) { }.bind(this)); }; -Compilation.prototype.seal = function seal(callback) { +Compilation.prototype.finish = function finish() { this.applyPlugins("finish-modules", this.modules); this.modules.forEach(function(m) { this.reportDependencyWarnings(m, [m]); }, this); +}; + +Compilation.prototype.unseal = function unseal() { + this.applyPlugins("unseal"); + this.chunks.length = 0; + this.namedChunks = {}; + this.nextFreeChunkId = this.nextFreeChunkIdBeforeSeal; + this.nextFreeModuleId = this.nextFreeModuleIdBeforeSeal; + this.nextFreeModuleIndex = this.nextFreeModuleIndexBeforeSeal; + this.nextFreeModuleIndex2 = this.nextFreeModuleIndex2BeforeSeal; + this.additionalChunkAssets.length = 0; + this.assets = {}; + this.modules.forEach(function(module) { + module.unseal(); + }); +}; + +Compilation.prototype.seal = function seal(callback) { this.applyPlugins("seal"); this.preparedChunks.sort(function(a, b) { if(a.name < b.name) return -1; if(a.name > b.name) return 1; return 0; }); + this.nextFreeChunkIdBeforeSeal = this.nextFreeChunkId; + this.nextFreeModuleIdBeforeSeal = this.nextFreeModuleId; + this.nextFreeModuleIndexBeforeSeal = this.nextFreeModuleIndex; + this.nextFreeModuleIndex2BeforeSeal = this.nextFreeModuleIndex2; this.preparedChunks.forEach(function(preparedChunk) { var module = preparedChunk.module; var chunk = this.addChunk(preparedChunk.name, module); - chunk.initial = chunk.entry = true; + var entrypoint = this.entrypoints[chunk.name] = new Entrypoint(chunk.name); + entrypoint.unshiftChunk(chunk); + chunk.addModule(module); module.addChunk(chunk); chunk.entryModule = module; @@ -528,14 +553,16 @@ Compilation.prototype.seal = function seal(callback) { var shouldRecord = this.applyPluginsBailResult("should-record") !== false; + this.sortItemsBeforeIds(); + this.applyPlugins("revive-modules", this.modules, this.records); this.applyPlugins("optimize-module-order", this.modules); this.applyPlugins("before-module-ids", this.modules); this.applyModuleIds(); this.applyPlugins("optimize-module-ids", this.modules); this.applyPlugins("after-optimize-module-ids", this.modules); - if(shouldRecord) - this.applyPlugins("record-modules", this.modules, this.records); + + this.sortItemsWithModuleIds(); this.applyPlugins("revive-chunks", this.chunks, this.records); this.applyPlugins("optimize-chunk-order", this.chunks); @@ -543,13 +570,21 @@ Compilation.prototype.seal = function seal(callback) { this.applyChunkIds(); this.applyPlugins("optimize-chunk-ids", this.chunks); this.applyPlugins("after-optimize-chunk-ids", this.chunks); + + this.sortItemswithChunkIds(); + + if(shouldRecord) + this.applyPlugins("record-modules", this.modules, this.records); if(shouldRecord) this.applyPlugins("record-chunks", this.chunks, this.records); - this.sortItems(); this.applyPlugins("before-hash"); this.createHash(); this.applyPlugins("after-hash"); + + if(shouldRecord) + this.applyPlugins("record-hash", this.records); + this.applyPlugins("before-module-assets"); this.createModuleAssets(); if(this.applyPluginsBailResult("should-generate-chunk-assets") !== false) { @@ -575,7 +610,11 @@ Compilation.prototype.seal = function seal(callback) { return callback(err); } this.applyPlugins("after-optimize-assets", this.assets); - return callback(); + if(this.applyPluginsBailResult("need-additional-seal")) { + this.unseal(); + return this.seal(callback); + } + return this.applyPluginsAsync("after-seal", callback); }.bind(this)); }.bind(this)); }.bind(this)); @@ -716,20 +755,28 @@ Compilation.prototype.applyChunkIds = function applyChunkIds() { }, this); }; -Compilation.prototype.sortItems = function sortItems() { - function byId(a, b) { - return a.id - b.id; - } - this.chunks.sort(byId); +function byId(a, b) { + return a.id - b.id; +} + +Compilation.prototype.sortItemsBeforeIds = function sortItemsBeforeIds() { + +}; + +Compilation.prototype.sortItemsWithModuleIds = function sortItemsWithModuleIds() { this.modules.sort(byId); this.modules.forEach(function(module) { - module.chunks.sort(byId); - module.reasons.sort(function(a, b) { - return byId(a.module, b.module); - }); + module.sortItems(); }); this.chunks.forEach(function(chunk) { - chunk.modules.sort(byId); + chunk.sortItems(); + }); +}; + +Compilation.prototype.sortItemswithChunkIds = function sortItemswithChunkIds() { + this.chunks.sort(byId); + this.modules.forEach(function(module) { + module.sortItems(); }); }; @@ -791,8 +838,10 @@ Compilation.prototype.createHash = function createHash() { var i, chunk; var chunks = this.chunks.slice(); chunks.sort(function(a, b) { - if(a.entry && !b.entry) return 1; - if(!a.entry && b.entry) return -1; + var aEntry = a.hasRuntime(); + var bEntry = b.hasRuntime(); + if(aEntry && !bEntry) return 1; + if(!aEntry && bEntry) return -1; return 0; }); for(i = 0; i < chunks.length; i++) { @@ -801,7 +850,7 @@ Compilation.prototype.createHash = function createHash() { if(outputOptions.hashSalt) hash.update(outputOptions.hashSalt); chunk.updateHash(chunkHash); - if(chunk.entry) { + if(chunk.hasRuntime()) { this.mainTemplate.updateHashForChunk(chunkHash, chunk); } else { this.chunkTemplate.updateHashForChunk(chunkHash); @@ -851,15 +900,15 @@ Compilation.prototype.createChunkAssets = function createChunkAssets() { var source; var file; var filenameTemplate = chunk.filenameTemplate ? chunk.filenameTemplate : - chunk.initial ? filename : + chunk.isInitial() ? filename : chunkFilename; try { - var useChunkHash = !chunk.entry || (this.mainTemplate.useChunkHash && this.mainTemplate.useChunkHash(chunk)); + var useChunkHash = !chunk.hasRuntime() || (this.mainTemplate.useChunkHash && this.mainTemplate.useChunkHash(chunk)); var usedHash = useChunkHash ? chunkHash : this.fullHash; if(this.cache && this.cache["c" + chunk.id] && this.cache["c" + chunk.id].hash === usedHash) { source = this.cache["c" + chunk.id].source; } else { - if(chunk.entry) { + if(chunk.hasRuntime()) { source = this.mainTemplate.render(this.hash, chunk, this.moduleTemplate, this.dependencyTemplates); } else { source = this.chunkTemplate.render(chunk, this.moduleTemplate, this.dependencyTemplates); diff --git a/lib/Compiler.js b/lib/Compiler.js index badfbd6bf2f..e005e1fd1d3 100644 --- a/lib/Compiler.js +++ b/lib/Compiler.js @@ -242,9 +242,12 @@ Compiler.prototype.runAsChild = function(callback) { this.parentCompilation.assets[name] = compilation.assets[name]; }.bind(this)); - var entries = compilation.chunks.filter(function(chunk) { - return chunk.entry; - }); + var entries = Object.keys(compilation.entrypoints).map(function(name) { + return compilation.entrypoints[name].chunks; + }).reduce(function(array, chunks) { + return array.concat(chunks); + }, []); + return callback(null, entries, compilation); }.bind(this)); }; @@ -428,6 +431,8 @@ Compiler.prototype.compile = function(callback) { this.applyPluginsParallel("make", compilation, function(err) { if(err) return callback(err); + compilation.finish(); + compilation.seal(function(err) { if(err) return callback(err); diff --git a/lib/DependenciesBlock.js b/lib/DependenciesBlock.js index cac9965e54e..8501a0dd9ff 100644 --- a/lib/DependenciesBlock.js +++ b/lib/DependenciesBlock.js @@ -49,9 +49,22 @@ DependenciesBlock.prototype.disconnect = function() { this.variables.forEach(disconnect); }; +DependenciesBlock.prototype.unseal = function() { + function unseal(i) { + i.unseal(); + } + this.blocks.forEach(unseal); +}; + DependenciesBlock.prototype.hasDependencies = function() { return this.dependencies.length > 0 || this.blocks.concat(this.variables).some(function(item) { return item.hasDependencies(); }); }; + +DependenciesBlock.prototype.sortItems = function() { + this.blocks.forEach(function(block) { + block.sortItems(); + }); +}; diff --git a/lib/Dependency.js b/lib/Dependency.js index d0b3d8e5473..0fd090613fb 100644 --- a/lib/Dependency.js +++ b/lib/Dependency.js @@ -36,32 +36,4 @@ Dependency.compare = function(a, b) { return Dependency.compareLocations(a.loc, b.loc); }; -Dependency.compareLocations = function(a, b) { - if(typeof a === "string") { - if(typeof b === "string") { - if(a < b) return -1; - if(a > b) return 1; - return 0; - } else if(typeof b === "object") { - return 1; - } else { - return 0; - } - } else if(typeof a === "object") { - if(typeof b === "string") { - return -1; - } else if(typeof b === "object") { - if(a.start) a = a.start; - if(b.start) b = b.start; - if(a.line < b.line) return -1; - if(a.line > b.line) return 1; - if(a.column < b.column) return -1; - if(a.column > b.column) return 1; - if(a.index < b.index) return -1; - if(a.index > b.index) return 1; - return 0; - } else { - return 0; - } - } -}; +Dependency.compareLocations = require("./compareLocations"); diff --git a/lib/Entrypoint.js b/lib/Entrypoint.js new file mode 100644 index 00000000000..5f76f78bd29 --- /dev/null +++ b/lib/Entrypoint.js @@ -0,0 +1,24 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +function Entrypoint(name) { + this.name = name; + this.chunks = []; +} +module.exports = Entrypoint; + +Entrypoint.prototype.unshiftChunk = function(chunk) { + this.chunks.unshift(chunk); + chunk.entrypoints.push(this); +}; + +Entrypoint.prototype.insertChunk = function(chunk, before) { + var idx = this.chunks.indexOf(before); + if(idx >= 0) { + this.chunks.splice(idx, 0, chunk); + } else { + throw new Error("before chunk not found"); + } + chunk.entrypoints.push(this); +}; diff --git a/lib/JsonpChunkTemplatePlugin.js b/lib/JsonpChunkTemplatePlugin.js index e59acb8d138..4bd139a7d49 100644 --- a/lib/JsonpChunkTemplatePlugin.js +++ b/lib/JsonpChunkTemplatePlugin.js @@ -14,9 +14,7 @@ JsonpChunkTemplatePlugin.prototype.apply = function(chunkTemplate) { var source = new ConcatSource(); source.add(jsonpFunction + "(" + JSON.stringify(chunk.ids) + ","); source.add(modules); - var entries = chunk.modules.filter(function(m) { - return m.entry; - }).map(function(m) { + var entries = [chunk.entryModule].filter(Boolean).map(function(m) { return m.id; }); if(entries.length > 0) { diff --git a/lib/LibManifestPlugin.js b/lib/LibManifestPlugin.js index e1d28a79b60..25ec02d8239 100644 --- a/lib/LibManifestPlugin.js +++ b/lib/LibManifestPlugin.js @@ -12,7 +12,7 @@ module.exports = LibManifestPlugin; LibManifestPlugin.prototype.apply = function(compiler) { compiler.plugin("emit", function(compilation, callback) { async.forEach(compilation.chunks, function(chunk, callback) { - if(!chunk.initial) { + if(!chunk.isInitial()) { callback(); return; } diff --git a/lib/MainTemplate.js b/lib/MainTemplate.js index bb9e2920b17..42c420645d2 100644 --- a/lib/MainTemplate.js +++ b/lib/MainTemplate.js @@ -172,9 +172,7 @@ MainTemplate.prototype.entryPointInChildren = function(chunk) { return chunk.chunks.some(function(child) { if(alreadyCheckedChunks.indexOf(child) >= 0) return; alreadyCheckedChunks.push(child); - return child.modules.some(function(module) { - return module.entry; - }) || checkChildren(child, alreadyCheckedChunks); + return child.hasEntryModule() || checkChildren(child, alreadyCheckedChunks); }); } return checkChildren(chunk, []); diff --git a/lib/Module.js b/lib/Module.js index 086e01078d9..0e9c9c567ff 100644 --- a/lib/Module.js +++ b/lib/Module.js @@ -33,6 +33,16 @@ module.exports = Module; Module.prototype = Object.create(DependenciesBlock.prototype); Module.prototype.constructor = Module; +Object.defineProperty(Module.prototype, "entry", { + configurable: false, + get: function() { + throw new Error("Module.entry was removed. Use Chunk.entryModule"); + }, + set: function() { + throw new Error("Module.entry was removed. Use Chunk.entryModule"); + } +}); + Module.prototype.disconnect = function() { this.reasons.length = 0; this.lastId = this.id; @@ -45,6 +55,15 @@ Module.prototype.disconnect = function() { DependenciesBlock.prototype.disconnect.call(this); }; +Module.prototype.unseal = function() { + this.lastId = this.id; + this.id = null; + this.index = null; + this.index2 = null; + this.chunks.length = 0; + DependenciesBlock.prototype.unseal.call(this); +}; + Module.prototype.addChunk = function(chunk) { var idx = this.chunks.indexOf(chunk); if(idx < 0) @@ -132,6 +151,18 @@ Module.prototype.updateHash = function(hash) { DependenciesBlock.prototype.updateHash.call(this, hash); }; +function byId(a, b) { + return a.id - b.id; +} + +Module.prototype.sortItems = function() { + DependenciesBlock.prototype.sortItems.call(this); + this.chunks.sort(byId); + this.reasons.sort(function(a, b) { + return byId(a.module, b.module); + }); +}; + Module.prototype.identifier = null; Module.prototype.readableIdentifier = null; Module.prototype.build = null; diff --git a/lib/Stats.js b/lib/Stats.js index 4f9e80c2f4a..2fe0364cedb 100644 --- a/lib/Stats.js +++ b/lib/Stats.js @@ -34,6 +34,7 @@ Stats.prototype.toJson = function toJson(options, forToString) { var showVersion = d(options.version, true); var showTimings = d(options.timings, true); var showAssets = d(options.assets, true); + var showEntrypoints = d(options.entrypoints, !forToString); var showChunks = d(options.chunks, true); var showChunkModules = d(options.chunkModules, !!forToString); var showChunkOrigins = d(options.chunkOrigins, !forToString); @@ -93,7 +94,7 @@ Stats.prototype.toJson = function toJson(options, forToString) { }; if(e.chunk) { text += "chunk " + (e.chunk.name || e.chunk.id) + - (e.chunk.entry ? " [entry]" : e.chunk.initial ? " [initial]" : "") + "\n"; + (e.chunk.hasRuntime() ? " [entry]" : e.chunk.isInitial() ? " [initial]" : "") + "\n"; } if(e.file) { text += e.file + "\n"; @@ -192,6 +193,21 @@ Stats.prototype.toJson = function toJson(options, forToString) { obj.assets.sort(sortByField(sortAssets)); } + if(showEntrypoints) { + obj.entrypoints = {}; + Object.keys(compilation.entrypoints).forEach(function(name) { + var ep = compilation.entrypoints[name]; + obj.entrypoints[name] = { + chunks: ep.chunks.map(function(c) { + return c.id; + }), + assets: ep.chunks.reduce(function(array, c) { + return array.concat(c.files || []); + }, []) + } + }); + } + function fnModule(module) { var obj = { id: module.id, @@ -252,8 +268,9 @@ Stats.prototype.toJson = function toJson(options, forToString) { var obj = { id: chunk.id, rendered: chunk.rendered, - initial: !!chunk.initial, - entry: !!chunk.entry, + initial: chunk.isInitial(), + entry: chunk.hasRuntime(), + recorded: chunk.recorded, extraAsync: !!chunk.extraAsync, size: chunk.modules.reduce(function(size, module) { return size + module.size(); @@ -454,6 +471,18 @@ Stats.jsonToString = function jsonToString(obj, useColors) { }); table(t, [colors.green, colors.normal, colors.bold, colors.green, colors.normal], "rrrll"); } + if(obj.entrypoints) { + Object.keys(obj.entrypoints).forEach(function(name) { + colors.normal("Entrypoint "); + colors.bold(name); + colors.normal(" ="); + obj.entrypoints[name].assets.forEach(function(asset) { + colors.normal(" "); + colors.green(asset); + }); + newline(); + }); + } var modulesByIdentifier = {}; if(obj.modules) { obj.modules.forEach(function(module) { @@ -553,9 +582,17 @@ Stats.jsonToString = function jsonToString(obj, useColors) { colors.yellow(id); colors.normal("}"); }); + if(chunk.entry) { + colors.yellow(" [entry]"); + } else if(chunk.initial) { + colors.yellow(" [initial]"); + } if(chunk.rendered) { colors.green(" [rendered]"); } + if(chunk.recorded) { + colors.green(" [recorded]"); + } newline(); if(chunk.origins) { chunk.origins.forEach(function(origin) { @@ -726,6 +763,7 @@ Stats.presetToOptions = function(name) { version: false, timings: false, assets: false, + entrypoints: false, chunks: false, modules: false, reasons: false, @@ -739,10 +777,11 @@ Stats.presetToOptions = function(name) { }; } else { return { - assets: pn === "verbose", + hash: pn !== "errors-only" && pn !== "minimal", version: pn === "verbose", timings: pn !== "errors-only" && pn !== "minimal", - hash: pn !== "errors-only" && pn !== "minimal", + assets: pn === "verbose", + entrypoints: pn === "verbose", chunks: pn !== "errors-only", chunkModules: pn === "verbose", //warnings: pn !== "errors-only", diff --git a/lib/compareLocations.js b/lib/compareLocations.js new file mode 100644 index 00000000000..bfac0ee1fea --- /dev/null +++ b/lib/compareLocations.js @@ -0,0 +1,33 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +module.exports = function compareLocations(a, b) { + if(typeof a === "string") { + if(typeof b === "string") { + if(a < b) return -1; + if(a > b) return 1; + return 0; + } else if(typeof b === "object") { + return 1; + } else { + return 0; + } + } else if(typeof a === "object") { + if(typeof b === "string") { + return -1; + } else if(typeof b === "object") { + if(a.start) a = a.start; + if(b.start) b = b.start; + if(a.line < b.line) return -1; + if(a.line > b.line) return 1; + if(a.column < b.column) return -1; + if(a.column > b.column) return 1; + if(a.index < b.index) return -1; + if(a.index > b.index) return 1; + return 0; + } else { + return 0; + } + } +}; diff --git a/lib/dependencies/DepBlockHelpers.js b/lib/dependencies/DepBlockHelpers.js index f1a088a7314..be32b721e90 100644 --- a/lib/dependencies/DepBlockHelpers.js +++ b/lib/dependencies/DepBlockHelpers.js @@ -15,7 +15,7 @@ DepBlockHelpers.getLoadDepBlockWrapper = function(depBlock, outputOptions, reque DepBlockHelpers.getDepBlockPromise = function(depBlock, outputOptions, requestShortener, name) { if(depBlock.chunks) { var chunks = depBlock.chunks.filter(function(chunk) { - return !chunk.entry && typeof chunk.id === "number"; + return !chunk.hasRuntime() && typeof chunk.id === "number"; }); if(chunks.length === 1) { var chunk = chunks[0]; diff --git a/lib/optimize/AggressiveMergingPlugin.js b/lib/optimize/AggressiveMergingPlugin.js index 157cd865f6f..45518f520e6 100644 --- a/lib/optimize/AggressiveMergingPlugin.js +++ b/lib/optimize/AggressiveMergingPlugin.js @@ -16,7 +16,7 @@ AggressiveMergingPlugin.prototype.apply = function(compiler) { function getParentsWeight(chunk) { return chunk.parents.map(function(p) { - return p.initial ? options.entryChunkMultiplicator || 10 : 1; + return p.isInitial() ? options.entryChunkMultiplicator || 10 : 1; }).reduce(function(a, b) { return a + b; }, 0); @@ -25,10 +25,10 @@ AggressiveMergingPlugin.prototype.apply = function(compiler) { compilation.plugin("optimize-chunks-advanced", function(chunks) { var combinations = []; chunks.forEach(function(a, idx) { - if(a.initial) return; + if(a.isInitial()) return; for(var i = 0; i < idx; i++) { var b = chunks[i]; - if(b.initial) continue; + if(b.isInitial()) continue; combinations.push([b, a]); } }); diff --git a/lib/optimize/AggressiveSplittingPlugin.js b/lib/optimize/AggressiveSplittingPlugin.js new file mode 100644 index 00000000000..08c95141d5f --- /dev/null +++ b/lib/optimize/AggressiveSplittingPlugin.js @@ -0,0 +1,184 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var path = require("path"); + +function AggressiveSplittingPlugin(options) { + this.options = options || {}; + if(typeof this.options.minSize !== "number") this.options.minSize = 30 * 1024; + if(typeof this.options.maxSize !== "number") this.options.maxSize = 50 * 1024; + if(typeof this.options.chunkOverhead !== "number") this.options.chunkOverhead = 0; + if(typeof this.options.entryChunkMultiplicator !== "number") this.options.entryChunkMultiplicator = 1; +} +module.exports = AggressiveSplittingPlugin; + +function makeRelative(compiler, identifier) { + var context = compiler.context; + return identifier.split("|").map(function(str) { + return str.split("!").map(function(str) { + return path.relative(context, str); + }).join("!"); + }).join("|"); +} + +function copyWithReason(obj) { + var newObj = {}; + Object.keys(obj).forEach(function(key) { + newObj[key] = obj[key]; + }); + if(!newObj.reasons || newObj.reasons.indexOf("aggressive-splitted") < 0) + newObj.reasons = (newObj.reasons || []).concat("aggressive-splitted"); + return newObj; +} + +AggressiveSplittingPlugin.prototype.apply = function(compiler) { + var _this = this; + compiler.plugin("compilation", function(compilation) { + compilation.plugin("optimize-chunks-advanced", function(chunks) { + var i, chunk, newChunk; + var savedSplits = compilation.records && compilation.records.aggressiveSplits || []; + var usedSplits = savedSplits; + if(compilation._aggressiveSplittingSplits) + usedSplits = usedSplits.concat(compilation._aggressiveSplittingSplits); + var minSize = _this.options.minSize; + var maxSize = _this.options.maxSize; + // 1. try to restore to recorded splitting + for(var j = 0; j < usedSplits.length; j++) { + var splitData = usedSplits[j]; + for(i = 0; i < chunks.length; i++) { + chunk = chunks[i]; + var chunkModuleNames = chunk.modules.map(function(m) { + return makeRelative(compiler, m.identifier()); + }); + if(chunkModuleNames.length < splitData.modules) + continue; + var moduleIndicies = splitData.modules.map(function(m) { + return chunkModuleNames.indexOf(m); + }); + var hasAllModules = moduleIndicies.every(function(idx) { + return idx >= 0; + }); + if(hasAllModules) { + if(chunkModuleNames.length > splitData.modules.length) { + var selectedModules = moduleIndicies.map(function(idx) { + return chunk.modules[idx]; + }); + newChunk = compilation.addChunk(); + selectedModules.forEach(function(m) { + chunk.moveModule(m, newChunk); + }); + chunk.split(newChunk); + chunk.name = null; + newChunk._fromAggressiveSplitting = true; + if(j < savedSplits.length) + newChunk._fromAggressiveSplittingIndex = j; + if(typeof splitData.id === "number") newChunk.id = splitData.id; + newChunk.origins = chunk.origins.map(copyWithReason); + chunk.origins = chunk.origins.map(copyWithReason); + return true; + } else { + if(j < savedSplits.length) + chunk._fromAggressiveSplittingIndex = j; + chunk.name = null; + if(typeof splitData.id === "number") chunk.id = splitData.id; + } + } + } + } + // 2. for any other chunk which isn't splitted yet, split it + for(i = 0; i < chunks.length; i++) { + chunk = chunks[i]; + var size = chunk.size(_this.options); + if(size > maxSize && chunk.modules.length > 1) { + newChunk = compilation.addChunk(); + var modules = chunk.modules.filter(function(m) { + return chunk.entryModule !== m; + }).sort(function(a, b) { + a = a.identifier(); + b = b.identifier(); + if(a > b) return 1; + if(a < b) return -1; + return 0; + }); + for(var k = 0; k < modules.length; k++) { + chunk.moveModule(modules[k], newChunk); + var newSize = newChunk.size(_this.options); + var chunkSize = chunk.size(_this.options); + // break early if it's fine + if(chunkSize < maxSize && newSize < maxSize && newSize >= minSize && chunkSize >= minSize) + break; + if(newSize > maxSize && k === 0) { + // break if there is a single module which is bigger than maxSize + break; + } + if(newSize > maxSize || chunkSize < minSize) { + // move it back + newChunk.moveModule(modules[k], chunk); + // check if it's fine now + if(newSize < maxSize && newSize >= minSize && chunkSize >= minSize) + break; + } + } + if(newChunk.modules.length > 0) { + chunk.split(newChunk); + chunk.name = null; + newChunk.origins = chunk.origins.map(copyWithReason); + chunk.origins = chunk.origins.map(copyWithReason); + compilation._aggressiveSplittingSplits = (compilation._aggressiveSplittingSplits || []).concat({ + modules: newChunk.modules.map(function(m) { + return makeRelative(compiler, m.identifier()); + }) + }); + return true; + } else { + chunks.splice(chunks.indexOf(newChunk), 1); + } + } + } + }); + compilation.plugin("record-hash", function(records) { + // 3. save to made splittings to records + var minSize = _this.options.minSize; + var maxSize = _this.options.maxSize; + if(!records.aggressiveSplits) records.aggressiveSplits = []; + compilation.chunks.forEach(function(chunk) { + if(chunk.hasEntryModule()) return; + var size = chunk.size(_this.options); + var incorrectSize = size < minSize; + var modules = chunk.modules.map(function(m) { + return makeRelative(compiler, m.identifier()); + }); + if(typeof chunk._fromAggressiveSplittingIndex === "undefined") { + if(incorrectSize) return; + chunk.recorded = true; + records.aggressiveSplits.push({ + modules: modules, + hash: chunk.hash, + id: chunk.id + }); + } else { + var splitData = records.aggressiveSplits[chunk._fromAggressiveSplittingIndex]; + if(splitData.hash !== chunk.hash || incorrectSize) { + if(chunk._fromAggressiveSplitting) { + chunk._aggressiveSplittingInvalid = true; + splitData.invalid = true; + } else { + splitData.hash = chunk.hash; + } + } + } + }); + records.aggressiveSplits = records.aggressiveSplits.filter(function(splitData) { + return !splitData.invalid; + }); + }); + compilation.plugin("need-additional-seal", function(callback) { + var invalid = this.chunks.some(function(chunk) { + return chunk._aggressiveSplittingInvalid; + }); + if(invalid) + return true; + }); + }); +}; diff --git a/lib/optimize/CommonsChunkPlugin.js b/lib/optimize/CommonsChunkPlugin.js index 98eecc90cfc..a01c8228bfb 100644 --- a/lib/optimize/CommonsChunkPlugin.js +++ b/lib/optimize/CommonsChunkPlugin.js @@ -60,7 +60,6 @@ CommonsChunkPlugin.prototype.apply = function(compiler) { })[0]; if(!chunk) { chunk = this.addChunk(chunkName); - chunk.initial = chunk.entry = true; } return chunk; }, this); @@ -80,14 +79,14 @@ CommonsChunkPlugin.prototype.apply = function(compiler) { return async || chunk.parents.length === 1; }); } else { - if(!commonChunk.entry) { + if(commonChunk.parents.length > 0) { compilation.errors.push(new Error("CommonsChunkPlugin: While running in normal mode it's not allowed to use a non-entry chunk (" + commonChunk.name + ")")); return; } usedChunks = chunks.filter(function(chunk) { var found = commonChunks.indexOf(chunk); if(found >= idx) return false; - return chunk.entry; + return chunk.hasRuntime(); }); } if(async) { @@ -145,7 +144,7 @@ CommonsChunkPlugin.prototype.apply = function(compiler) { }); if(async) { reallyUsedChunks.forEach(function(chunk) { - if(chunk.initial || chunk.entry) + if(chunk.isInitial()) return; chunk.blocks.forEach(function(block) { block.chunks.unshift(commonChunk); @@ -166,13 +165,10 @@ CommonsChunkPlugin.prototype.apply = function(compiler) { } else { usedChunks.forEach(function(chunk) { chunk.parents = [commonChunk]; + chunk.entrypoints.forEach(function(ep) { + ep.insertChunk(commonChunk, chunk); + }); commonChunk.chunks.push(chunk); - if(chunk.initial) - commonChunk.initial = true; - if(chunk.entry) { - commonChunk.entry = true; - chunk.entry = false; - } }); } if(filenameTemplate) diff --git a/lib/optimize/DedupePlugin.js b/lib/optimize/DedupePlugin.js index 1253b1d1558..6e7132e1632 100644 --- a/lib/optimize/DedupePlugin.js +++ b/lib/optimize/DedupePlugin.js @@ -33,7 +33,7 @@ DedupePlugin.prototype.apply = function(compiler) { } }); var entryChunks = chunks.filter(function(c) { - return c.entry; + return c.hasRuntime(); }); entryChunks.forEach(function(chunk) { // for each entry chunk var hasDeduplicatedModules = false; diff --git a/lib/optimize/MergeDuplicateChunksPlugin.js b/lib/optimize/MergeDuplicateChunksPlugin.js index 5e261899449..db9803588a7 100644 --- a/lib/optimize/MergeDuplicateChunksPlugin.js +++ b/lib/optimize/MergeDuplicateChunksPlugin.js @@ -16,7 +16,7 @@ MergeDuplicateChunksPlugin.prototype.apply = function(compiler) { compilation.plugin("optimize-chunks-basic", function(chunks) { var map = {}; chunks.slice().forEach(function(chunk) { - if(chunk.initial) return; + if(chunk.hasRuntime() || chunk.hasEntryModule()) return; var ident = getChunkIdentifier(chunk); if(map[ident]) { if(map[ident].integrate(chunk, "duplicate")) diff --git a/lib/optimize/OccurrenceOrderPlugin.js b/lib/optimize/OccurrenceOrderPlugin.js index add8afd8d7a..258f1497e6c 100644 --- a/lib/optimize/OccurrenceOrderPlugin.js +++ b/lib/optimize/OccurrenceOrderPlugin.js @@ -14,9 +14,12 @@ OccurrenceOrderPlugin.prototype.apply = function(compiler) { compiler.plugin("compilation", function(compilation) { compilation.plugin("optimize-module-order", function(modules) { function entryChunks(m) { - return m.chunks.filter(function(c) { - return c.initial; - }).length + (m.entry ? 1 : 0); + return m.chunks.map(function(c) { + var sum = (c.isInitial() ? 1 : 0) + (c.entryModule === m ? 1 : 0); + return sum; + }).reduce(function(a, b) { + return a + b; + }, 0); } function occursInEntry(m) { @@ -34,7 +37,9 @@ OccurrenceOrderPlugin.prototype.apply = function(compiler) { return r.module.chunks.length; }).reduce(function(a, b) { return a + b; - }, 0) + m.chunks.length + (m.entry ? 1 : 0); + }, 0) + m.chunks.length + m.chunks.filter(function(c) { + c.entryModule === m; + }).length; } modules.sort(function(a, b) { if(preferEntry) { @@ -55,12 +60,12 @@ OccurrenceOrderPlugin.prototype.apply = function(compiler) { compilation.plugin("optimize-chunk-order", function(chunks) { function occursInEntry(c) { return c.parents.filter(function(p) { - return p.initial; - }).length + (c.entry ? 1 : 0); + return p.isInitial(); + }).length; } function occurs(c) { - return c.blocks.length + (c.entry ? 1 : 0); + return c.blocks.length; } chunks.forEach(function(c) { c.modules.sort(function(a, b) { diff --git a/lib/optimize/RemoveEmptyChunksPlugin.js b/lib/optimize/RemoveEmptyChunksPlugin.js index 67e16e0d431..74097fc5167 100644 --- a/lib/optimize/RemoveEmptyChunksPlugin.js +++ b/lib/optimize/RemoveEmptyChunksPlugin.js @@ -9,7 +9,7 @@ RemoveEmptyChunksPlugin.prototype.apply = function(compiler) { compiler.plugin("compilation", function(compilation) { compilation.plugin(["optimize-chunks-basic", "optimize-extracted-chunks-basic"], function(chunks) { chunks.filter(function(chunk) { - return chunk.isEmpty() && !chunk.initial; + return chunk.isEmpty() && !chunk.hasRuntime() && !chunk.hasEntryModule(); }).forEach(function(chunk) { chunk.remove("empty"); chunks.splice(chunks.indexOf(chunk), 1); diff --git a/lib/optimize/RemoveParentModulesPlugin.js b/lib/optimize/RemoveParentModulesPlugin.js index 2c0fa83b9c6..d848c74a894 100644 --- a/lib/optimize/RemoveParentModulesPlugin.js +++ b/lib/optimize/RemoveParentModulesPlugin.js @@ -14,7 +14,7 @@ function chunkContainsModule(chunk, module) { function hasModule(chunk, module, checkedChunks) { if(chunkContainsModule(chunk, module)) return [chunk]; - if(chunk.entry) return false; + if(chunk.parents.length === 0) return false; return allHaveModule(chunk.parents.filter(function(c) { return checkedChunks.indexOf(c) < 0; }), module, checkedChunks); @@ -61,7 +61,7 @@ RemoveParentModulesPlugin.prototype.apply = function(compiler) { chunks.forEach(function(chunk) { var cache = {}; chunk.modules.slice().forEach(function(module) { - if(chunk.entry) return; + if(chunk.parents.length === 0) return; var dId = "$" + debugIds(module.chunks); var parentChunksWithModule; if((dId in cache) && dId !== "$no") { diff --git a/lib/webpack.js b/lib/webpack.js index a72df030330..cf3fe0affcd 100644 --- a/lib/webpack.js +++ b/lib/webpack.js @@ -97,6 +97,7 @@ exportPlugins(exports, ".", [ ]); exportPlugins(exports.optimize = {}, "./optimize", [ "AggressiveMergingPlugin", + "AggressiveSplittingPlugin", "CommonsChunkPlugin", "DedupePlugin", "LimitChunkCountPlugin", diff --git a/package.json b/package.json index 10d2c6dc5df..2829390a1b7 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "es6-promise-polyfill": "^1.1.1", "eslint": "^1.1.0", "express": "~4.13.1", - "extract-text-webpack-plugin": "^1.0.0", + "extract-text-webpack-plugin": "~2.0.0-beta.0", "file-loader": "~0.8.0", "i18n-webpack-plugin": "~0.2.0", "istanbul": "^0.4.1", @@ -50,6 +50,8 @@ "mocha": "^2.3.4", "mocha-lcov-reporter": "^1.0.0", "raw-loader": "~0.5.0", + "react": "^15.2.1", + "react-dom": "^15.2.1", "script-loader": "~0.6.0", "should": "^8.0.2", "style-loader": "~0.13.0", diff --git a/test/Stats.test.js b/test/Stats.test.js index 0ab0851df3f..5973f91e25c 100644 --- a/test/Stats.test.js +++ b/test/Stats.test.js @@ -133,6 +133,7 @@ describe("Stats", function() { errors: ['firstError'], warnings: [], assets: [], + entrypoints: {}, chunks: [], modules: [], children: [], @@ -155,6 +156,7 @@ describe("Stats", function() { version: false, timings: true, hash: true, + entrypoints: false, chunks: true, chunkModules: false, errorDetails: true, @@ -178,6 +180,7 @@ describe("Stats", function() { version: false, timings: false, assets: false, + entrypoints: false, chunks: false, modules: false, reasons: false, diff --git a/test/cases/parsing/harmony-spec/index.js b/test/cases/parsing/harmony-spec/index.js index 8bb3873a0cd..d4e12cddc67 100644 --- a/test/cases/parsing/harmony-spec/index.js +++ b/test/cases/parsing/harmony-spec/index.js @@ -3,6 +3,7 @@ import { value as value2, add as add2 } from "./live-es5"; import { getLog } from "./order-tracker"; import "./order-c"; import cycleValue from "./export-cycle-a"; +import { data } from "./self-cycle"; it("should establish live binding of values", function() { value.should.be.eql(0); @@ -30,4 +31,8 @@ it("should bind exports before the module executes", function() { cycleValue.should.be.eql(true); }); +it("should allow to import live variables from itself", function() { + data.should.be.eql([undefined, 1, 2]); +}); + import { value as valueEval, evalInModule } from "./eval"; diff --git a/test/cases/parsing/harmony-spec/self-cycle.js b/test/cases/parsing/harmony-spec/self-cycle.js new file mode 100644 index 00000000000..e2417b3ff3c --- /dev/null +++ b/test/cases/parsing/harmony-spec/self-cycle.js @@ -0,0 +1,10 @@ +import { a as b } from "./self-cycle"; + +var data = []; + +data.push(b); +var a = 1; +data.push(b); +a = 2; +data.push(b); +export { a, data } diff --git a/test/configCases/plugins/lib-manifest-plugin/index.js b/test/configCases/plugins/lib-manifest-plugin/index.js index 3d98975ea23..77b434d6999 100644 --- a/test/configCases/plugins/lib-manifest-plugin/index.js +++ b/test/configCases/plugins/lib-manifest-plugin/index.js @@ -13,5 +13,5 @@ it("should write the correct manifest", function() { manifest.should.have.key("content", "name"); manifest.content.should.not.have.property("./a.js"); manifest.content.should.have.property("./index.js"); - manifest.content["./index.js"].should.eql(0); + manifest.content["./index.js"].should.eql(module.id); }); diff --git a/test/statsCases/aggressive-splitting-entry/a.js b/test/statsCases/aggressive-splitting-entry/a.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/a.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/b.js b/test/statsCases/aggressive-splitting-entry/b.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/b.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/c.js b/test/statsCases/aggressive-splitting-entry/c.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/c.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/d.js b/test/statsCases/aggressive-splitting-entry/d.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/d.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/e.js b/test/statsCases/aggressive-splitting-entry/e.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/e.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/expected.txt b/test/statsCases/aggressive-splitting-entry/expected.txt new file mode 100644 index 00000000000..26044091281 --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/expected.txt @@ -0,0 +1,24 @@ +Hash: 8e46421d7f7a7d266a00 +Time: Xms + Asset Size Chunks Chunk Names +48c8b1dae03a37363ec8.js 3.76 kB 1 [emitted] +2fa7af5012a3d8b778dd.js 2.22 kB 2 [emitted] +a5b577236621262c2bcf.js 1.93 kB 3 [emitted] +88d78642a86768757078.js 977 bytes 4 [emitted] +Entrypoint main = 48c8b1dae03a37363ec8.js a5b577236621262c2bcf.js 88d78642a86768757078.js 2fa7af5012a3d8b778dd.js +chunk {1} 48c8b1dae03a37363ec8.js 1.8 kB [entry] [rendered] + > aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js + [0] (webpack)/test/statsCases/aggressive-splitting-entry/b.js 899 bytes {1} [built] + [1] (webpack)/test/statsCases/aggressive-splitting-entry/c.js 899 bytes {1} [built] +chunk {2} 2fa7af5012a3d8b778dd.js 1.91 kB [initial] [rendered] + > aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js + [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js 112 bytes {2} [built] + [6] (webpack)/test/statsCases/aggressive-splitting-entry/f.js 899 bytes {2} [built] + [7] (webpack)/test/statsCases/aggressive-splitting-entry/g.js 899 bytes {2} [built] +chunk {3} a5b577236621262c2bcf.js 1.8 kB [initial] [rendered] [recorded] + > aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js + [2] (webpack)/test/statsCases/aggressive-splitting-entry/d.js 899 bytes {3} [built] + [5] (webpack)/test/statsCases/aggressive-splitting-entry/a.js 899 bytes {3} [built] +chunk {4} 88d78642a86768757078.js 899 bytes [initial] [rendered] + > aggressive-splitted main [4] (webpack)/test/statsCases/aggressive-splitting-entry/index.js + [3] (webpack)/test/statsCases/aggressive-splitting-entry/e.js 899 bytes {4} [built] \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/f.js b/test/statsCases/aggressive-splitting-entry/f.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/f.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/g.js b/test/statsCases/aggressive-splitting-entry/g.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/g.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/index.js b/test/statsCases/aggressive-splitting-entry/index.js new file mode 100644 index 00000000000..d1afec729a0 --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/index.js @@ -0,0 +1,7 @@ +require("./a"); +require("./b"); +require("./c"); +require("./d"); +require("./e"); +require("./f"); +require("./g"); diff --git a/test/statsCases/aggressive-splitting-entry/input-records.json b/test/statsCases/aggressive-splitting-entry/input-records.json new file mode 100644 index 00000000000..40577dbd74e --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/input-records.json @@ -0,0 +1,27 @@ +{ + "nextFreeModuleId": 5, + "modules": { + "byIdentifier": { + "b.js": 0, + "c.js": 1, + "d.js": 2, + "e.js": 3, + "index.js": 4 + } + }, + "nextFreeChunkId": 2, + "chunks": { + "byName": {}, + "byBlocks": {} + }, + "aggressiveSplits": [ + { + "modules": [ + "b.js", + "c.js" + ], + "hash": "48c8b1dae03a37363ec82be4f7b781bc", + "id": 1 + } + ] +} \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/records.json b/test/statsCases/aggressive-splitting-entry/records.json new file mode 100644 index 00000000000..795d2ec690d --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/records.json @@ -0,0 +1,38 @@ +{ + "nextFreeModuleId": 8, + "modules": { + "byIdentifier": { + "b.js": 0, + "c.js": 1, + "d.js": 2, + "e.js": 3, + "index.js": 4, + "a.js": 5, + "f.js": 6, + "g.js": 7 + } + }, + "nextFreeChunkId": 5, + "chunks": { + "byName": {}, + "byBlocks": {} + }, + "aggressiveSplits": [ + { + "modules": [ + "b.js", + "c.js" + ], + "hash": "48c8b1dae03a37363ec82be4f7b781bc", + "id": 1 + }, + { + "modules": [ + "a.js", + "d.js" + ], + "hash": "a5b577236621262c2bcf4c70b743a3bf", + "id": 3 + } + ] +} \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-entry/webpack.config.js b/test/statsCases/aggressive-splitting-entry/webpack.config.js new file mode 100644 index 00000000000..1f8169d12e9 --- /dev/null +++ b/test/statsCases/aggressive-splitting-entry/webpack.config.js @@ -0,0 +1,33 @@ +var webpack = require("../../../"); +module.exports = { + entry: "./index", + output: { + filename: "[chunkhash].js", + chunkFilename: "[chunkhash].js" + }, + plugins: [ + new webpack.optimize.AggressiveSplittingPlugin({ + chunkOverhead: 0, + entryChunkMultiplicator: 1, + minSize: 1500, + maxSize: 2500 + }) + ], + recordsInputPath: __dirname + "/input-records.json", + recordsOutputPath: __dirname + "/records.json", + stats: { + reasons: false, + chunkModules: true, + chunkOrigins: true, + entrypoints: true, + modules: false, + cached: true, + cachedAssets: true, + source: true, + errorDetails: true, + publicPath: true, + excludeModules: [ + /e\.js/ + ] + } +}; \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/a.js b/test/statsCases/aggressive-splitting-on-demand/a.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/a.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/b.js b/test/statsCases/aggressive-splitting-on-demand/b.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/b.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/c.js b/test/statsCases/aggressive-splitting-on-demand/c.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/c.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/d.js b/test/statsCases/aggressive-splitting-on-demand/d.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/d.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/e.js b/test/statsCases/aggressive-splitting-on-demand/e.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/e.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/expected.txt b/test/statsCases/aggressive-splitting-on-demand/expected.txt new file mode 100644 index 00000000000..5ca594833d0 --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/expected.txt @@ -0,0 +1,49 @@ +Hash: a562f01542f9b2e2ad89 +Time: Xms + Asset Size Chunks Chunk Names +7434ce273df5c166f742.js 1.93 kB 0 [emitted] +11324f155de813ceb658.js 1.95 kB 1 [emitted] +5ae9e18455b866684bd0.js 1.94 kB 2 [emitted] +e91ec4902ca3057b42bb.js 1.93 kB 3 [emitted] +0947f0875d56ab0bfe02.js 977 bytes 4 [emitted] +6335d9dcc7fa048743b7.js 6.74 kB 6 [emitted] main +cf500be0e585f01d2ccb.js 983 bytes 9 [emitted] +a7bfb642a544b4302cc4.js 975 bytes 11 [emitted] +Entrypoint main = 6335d9dcc7fa048743b7.js +chunk {0} 7434ce273df5c166f742.js 1.8 kB {6} [recorded] + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 4:0-51 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 5:0-44 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 6:0-72 + [5] (webpack)/test/statsCases/aggressive-splitting-on-demand/f.js 899 bytes {0} [built] + [6] (webpack)/test/statsCases/aggressive-splitting-on-demand/g.js 901 bytes {0} [built] +chunk {1} 11324f155de813ceb658.js 1.8 kB {6} + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 3:0-30 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 5:0-44 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 6:0-72 + [3] (webpack)/test/statsCases/aggressive-splitting-on-demand/d.js 899 bytes {1} [built] + [4] (webpack)/test/statsCases/aggressive-splitting-on-demand/e.js 899 bytes {1} [built] +chunk {2} 5ae9e18455b866684bd0.js 1.8 kB {6} [recorded] + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 4:0-51 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 6:0-72 + [10] (webpack)/test/statsCases/aggressive-splitting-on-demand/j.js 901 bytes {2} [built] + [11] (webpack)/test/statsCases/aggressive-splitting-on-demand/k.js 899 bytes {2} [built] +chunk {3} e91ec4902ca3057b42bb.js 1.8 kB {6} + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 4:0-51 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 6:0-72 + [7] (webpack)/test/statsCases/aggressive-splitting-on-demand/h.js 899 bytes {3} [built] + [8] (webpack)/test/statsCases/aggressive-splitting-on-demand/i.js 899 bytes {3} [built] +chunk {4} 0947f0875d56ab0bfe02.js 899 bytes {6} [rendered] + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 2:0-23 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 3:0-30 + [2] (webpack)/test/statsCases/aggressive-splitting-on-demand/c.js 899 bytes {4} [built] +chunk {6} 6335d9dcc7fa048743b7.js (main) 248 bytes [entry] [rendered] + > main [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js + [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 248 bytes {6} [built] +chunk {9} cf500be0e585f01d2ccb.js 899 bytes {6} + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 2:0-23 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 5:0-44 + > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 6:0-72 + [1] (webpack)/test/statsCases/aggressive-splitting-on-demand/b.js 899 bytes {9} [built] +chunk {11} a7bfb642a544b4302cc4.js 899 bytes {6} + > [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 1:0-16 + [0] (webpack)/test/statsCases/aggressive-splitting-on-demand/a.js 899 bytes {11} [built] \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/f.js b/test/statsCases/aggressive-splitting-on-demand/f.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/f.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/g.js b/test/statsCases/aggressive-splitting-on-demand/g.js new file mode 100644 index 00000000000..1cbeb3c518d --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/g.js @@ -0,0 +1,9 @@ +///*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/h.js b/test/statsCases/aggressive-splitting-on-demand/h.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/h.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/i.js b/test/statsCases/aggressive-splitting-on-demand/i.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/i.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/index.js b/test/statsCases/aggressive-splitting-on-demand/index.js new file mode 100644 index 00000000000..688e14c16e8 --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/index.js @@ -0,0 +1,6 @@ +require(["./a"]); +require(["./b", "./c"]); +require(["./c", "./d", "./e"]); +require(["./f", "./g", "./h", "./i", "./j", "./k"]); +require(["./b", "./d", "./e", "./f", "./g"]); +require(["./b", "./d", "./e", "./f", "./g", "./h", "./i", "./j", "./k"]); diff --git a/test/statsCases/aggressive-splitting-on-demand/input-records.json b/test/statsCases/aggressive-splitting-on-demand/input-records.json new file mode 100644 index 00000000000..6b8df9a3f03 --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/input-records.json @@ -0,0 +1,87 @@ +{ + "nextFreeModuleId": 12, + "modules": { + "byIdentifier": { + "a.js": 0, + "b.js": 1, + "c.js": 2, + "d.js": 3, + "e.js": 4, + "f.js": 5, + "g.js": 6, + "h.js": 7, + "i.js": 8, + "index.js": 9, + "j.js": 10, + "k.js": 11 + } + }, + "nextFreeChunkId": 9, + "chunks": { + "byName": { + "main": 6 + }, + "byBlocks": { + "index.js:4/4:2": 0, + "index.js:3/4:0": 0, + "index.js:2/4:1": 1, + "index.js:4/4:1": 1, + "index.js:3/4:2": 2, + "index.js:3/4:1": 3, + "index.js:1/4": 4, + "index.js:4/4:0": 5, + "index.js:2/4:0": 7, + "index.js:0/4": 8 + } + }, + "aggressiveSplits": [ + { + "modules": [ + "f.js", + "g.js" + ], + "hash": "7305696cca6d0d86929132c69380763f", + "id": 0 + }, + { + "modules": [ + "d.js", + "e.js" + ], + "hash": "11324f155de813ceb6584bbb3820bce4", + "id": 1 + }, + { + "modules": [ + "j.js", + "k.js" + ], + "hash": "f829c6691cc38a359481f2a5ca94a222", + "id": 2 + }, + { + "modules": [ + "h.js", + "i.js" + ], + "hash": "e91ec4902ca3057b42bb3d87c855733c", + "id": 3 + }, + { + "modules": [ + "b.js", + "c.js" + ], + "hash": "678b5386af25333c26261e48622f4864", + "id": 4 + }, + { + "modules": [ + "a.js", + "b.js" + ], + "hash": "2a1056b05b68590f7fad418ec0619c8d", + "id": 5 + } + ] +} \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/j.js b/test/statsCases/aggressive-splitting-on-demand/j.js new file mode 100644 index 00000000000..1cbeb3c518d --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/j.js @@ -0,0 +1,9 @@ +///*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/k.js b/test/statsCases/aggressive-splitting-on-demand/k.js new file mode 100644 index 00000000000..8d8eca129cf --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/k.js @@ -0,0 +1,9 @@ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ +/*************************************************************************************************/ \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/records.json b/test/statsCases/aggressive-splitting-on-demand/records.json new file mode 100644 index 00000000000..6111fc0646e --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/records.json @@ -0,0 +1,104 @@ +{ + "nextFreeModuleId": 12, + "modules": { + "byIdentifier": { + "a.js": 0, + "b.js": 1, + "c.js": 2, + "d.js": 3, + "e.js": 4, + "f.js": 5, + "g.js": 6, + "h.js": 7, + "i.js": 8, + "index.js": 9, + "j.js": 10, + "k.js": 11 + } + }, + "nextFreeChunkId": 12, + "chunks": { + "byName": { + "main": 6 + }, + "byBlocks": { + "index.js:4/4:2": 0, + "index.js:3/4:0": 0, + "index.js:2/4:1": 1, + "index.js:4/4:1": 1, + "index.js:3/4:2": 2, + "index.js:3/4:1": 3, + "index.js:1/4": 4, + "index.js:4/4:0": 5, + "index.js:2/4:0": 7, + "index.js:0/4": 8, + "index.js:3/5:0": 0, + "index.js:4/5:2": 0, + "index.js:5/5:2": 0, + "index.js:2/5:1": 1, + "index.js:4/5:1": 1, + "index.js:5/5:1": 1, + "index.js:3/5:2": 2, + "index.js:5/5:4": 2, + "index.js:3/5:1": 3, + "index.js:5/5:3": 3, + "index.js:1/5": 4, + "index.js:4/5:0": 9, + "index.js:5/5:0": 9, + "index.js:2/5:0": 4, + "index.js:0/5": 11, + "index.js:1/5:1": 4, + "index.js:1/5:0": 9 + } + }, + "aggressiveSplits": [ + { + "modules": [ + "d.js", + "e.js" + ], + "hash": "11324f155de813ceb6584bbb3820bce4", + "id": 1 + }, + { + "modules": [ + "h.js", + "i.js" + ], + "hash": "e91ec4902ca3057b42bb3d87c855733c", + "id": 3 + }, + { + "modules": [ + "b.js", + "c.js" + ], + "hash": "0947f0875d56ab0bfe02f1ea31783ed8", + "id": 4 + }, + { + "modules": [ + "a.js", + "b.js" + ], + "hash": "2a1056b05b68590f7fad418ec0619c8d", + "id": 5 + }, + { + "modules": [ + "f.js", + "g.js" + ], + "hash": "7434ce273df5c166f742c631347b7aec", + "id": 0 + }, + { + "modules": [ + "j.js", + "k.js" + ], + "hash": "5ae9e18455b866684bd0e85f8c7a8181", + "id": 2 + } + ] +} \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/webpack.config.js b/test/statsCases/aggressive-splitting-on-demand/webpack.config.js new file mode 100644 index 00000000000..1f8169d12e9 --- /dev/null +++ b/test/statsCases/aggressive-splitting-on-demand/webpack.config.js @@ -0,0 +1,33 @@ +var webpack = require("../../../"); +module.exports = { + entry: "./index", + output: { + filename: "[chunkhash].js", + chunkFilename: "[chunkhash].js" + }, + plugins: [ + new webpack.optimize.AggressiveSplittingPlugin({ + chunkOverhead: 0, + entryChunkMultiplicator: 1, + minSize: 1500, + maxSize: 2500 + }) + ], + recordsInputPath: __dirname + "/input-records.json", + recordsOutputPath: __dirname + "/records.json", + stats: { + reasons: false, + chunkModules: true, + chunkOrigins: true, + entrypoints: true, + modules: false, + cached: true, + cachedAssets: true, + source: true, + errorDetails: true, + publicPath: true, + excludeModules: [ + /e\.js/ + ] + } +}; \ No newline at end of file diff --git a/test/statsCases/chunks/expected.txt b/test/statsCases/chunks/expected.txt index 05fa00a4c6c..d4a3053f62f 100644 --- a/test/statsCases/chunks/expected.txt +++ b/test/statsCases/chunks/expected.txt @@ -1,49 +1,49 @@ -Hash: 55b4e00b04fd0c502b1f +Hash: 160bbe49f674da1a2284 Time: Xms Asset Size Chunks Chunk Names - bundle.js 5.29 kB 0 [emitted] main -1.bundle.js 251 bytes 1 [emitted] -2.bundle.js 106 bytes 2 [emitted] -3.bundle.js 200 bytes 3 [emitted] -chunk {0} bundle.js (main) 73 bytes [rendered] - > main [5] (webpack)/test/statsCases/chunks/index.js - [0] (webpack)/test/statsCases/chunks/a.js 22 bytes {0} [built] - cjs require ./a [5] (webpack)/test/statsCases/chunks/index.js 1:0-14 - [] -> factory:Xms building:Xms = Xms - [5] (webpack)/test/statsCases/chunks/index.js 51 bytes {0} [built] - factory:Xms building:Xms = Xms -chunk {1} 1.bundle.js 54 bytes {0} [rendered] +0.bundle.js 251 bytes 0 [emitted] +1.bundle.js 106 bytes 1 [emitted] +2.bundle.js 200 bytes 2 [emitted] + bundle.js 5.29 kB 3 [emitted] main +chunk {0} 0.bundle.js 54 bytes {3} [rendered] > [5] (webpack)/test/statsCases/chunks/index.js 3:0-16 - [2] (webpack)/test/statsCases/chunks/c.js 54 bytes {1} [built] + [2] (webpack)/test/statsCases/chunks/c.js 54 bytes {0} [built] amd require ./c [5] (webpack)/test/statsCases/chunks/index.js 3:0-16 [] -> factory:Xms building:Xms = Xms -chunk {2} 2.bundle.js 22 bytes {0} [rendered] +chunk {1} 1.bundle.js 22 bytes {3} [rendered] > [5] (webpack)/test/statsCases/chunks/index.js 2:0-16 - [1] (webpack)/test/statsCases/chunks/b.js 22 bytes {2} [built] + [1] (webpack)/test/statsCases/chunks/b.js 22 bytes {1} [built] amd require ./b [5] (webpack)/test/statsCases/chunks/index.js 2:0-16 [] -> factory:Xms building:Xms = Xms -chunk {3} 3.bundle.js 44 bytes {1} [rendered] +chunk {2} 2.bundle.js 44 bytes {0} [rendered] > [2] (webpack)/test/statsCases/chunks/c.js 1:0-52 - [3] (webpack)/test/statsCases/chunks/d.js 22 bytes {3} [built] + [3] (webpack)/test/statsCases/chunks/d.js 22 bytes {2} [built] require.ensure item ./d [2] (webpack)/test/statsCases/chunks/c.js 1:0-52 [] -> factory:Xms building:Xms = Xms - [4] (webpack)/test/statsCases/chunks/e.js 22 bytes {3} [built] + [4] (webpack)/test/statsCases/chunks/e.js 22 bytes {2} [built] require.ensure item ./e [2] (webpack)/test/statsCases/chunks/c.js 1:0-52 [] -> factory:Xms building:Xms = Xms - [0] (webpack)/test/statsCases/chunks/a.js 22 bytes {0} [built] +chunk {3} bundle.js (main) 73 bytes [entry] [rendered] + > main [5] (webpack)/test/statsCases/chunks/index.js + [0] (webpack)/test/statsCases/chunks/a.js 22 bytes {3} [built] + cjs require ./a [5] (webpack)/test/statsCases/chunks/index.js 1:0-14 + [] -> factory:Xms building:Xms = Xms + [5] (webpack)/test/statsCases/chunks/index.js 51 bytes {3} [built] + factory:Xms building:Xms = Xms + [0] (webpack)/test/statsCases/chunks/a.js 22 bytes {3} [built] cjs require ./a [5] (webpack)/test/statsCases/chunks/index.js 1:0-14 [] -> factory:Xms building:Xms = Xms - [1] (webpack)/test/statsCases/chunks/b.js 22 bytes {2} [built] + [1] (webpack)/test/statsCases/chunks/b.js 22 bytes {1} [built] amd require ./b [5] (webpack)/test/statsCases/chunks/index.js 2:0-16 [] -> factory:Xms building:Xms = Xms - [2] (webpack)/test/statsCases/chunks/c.js 54 bytes {1} [built] + [2] (webpack)/test/statsCases/chunks/c.js 54 bytes {0} [built] amd require ./c [5] (webpack)/test/statsCases/chunks/index.js 3:0-16 [] -> factory:Xms building:Xms = Xms - [3] (webpack)/test/statsCases/chunks/d.js 22 bytes {3} [built] + [3] (webpack)/test/statsCases/chunks/d.js 22 bytes {2} [built] require.ensure item ./d [2] (webpack)/test/statsCases/chunks/c.js 1:0-52 [] -> factory:Xms building:Xms = Xms - [4] (webpack)/test/statsCases/chunks/e.js 22 bytes {3} [built] + [4] (webpack)/test/statsCases/chunks/e.js 22 bytes {2} [built] require.ensure item ./e [2] (webpack)/test/statsCases/chunks/c.js 1:0-52 [] -> factory:Xms building:Xms = Xms - [5] (webpack)/test/statsCases/chunks/index.js 51 bytes {0} [built] + [5] (webpack)/test/statsCases/chunks/index.js 51 bytes {3} [built] factory:Xms building:Xms = Xms \ No newline at end of file diff --git a/test/statsCases/color-disabled/expected.txt b/test/statsCases/color-disabled/expected.txt index 0c66e335916..644c3363aa9 100644 --- a/test/statsCases/color-disabled/expected.txt +++ b/test/statsCases/color-disabled/expected.txt @@ -1,6 +1,6 @@ -Hash: 0fca0b37055d42f98682 +Hash: 6c781fe6bf412ba6435b Time: Xms Asset Size Chunks Chunk Names main.js 2.02 kB 0 [emitted] main -chunk {0} main.js (main) 0 bytes [rendered] +chunk {0} main.js (main) 0 bytes [entry] [rendered] [0] (webpack)/test/statsCases/color-disabled/index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/color-enabled-custom/expected.txt b/test/statsCases/color-enabled-custom/expected.txt index f780939e60a..d751d43e764 100644 --- a/test/statsCases/color-enabled-custom/expected.txt +++ b/test/statsCases/color-enabled-custom/expected.txt @@ -1,6 +1,6 @@ -Hash: 0fca0b37055d42f98682 +Hash: 6c781fe6bf412ba6435b Time: Xms Asset Size Chunks Chunk Names main.js 2.02 kB 0 [emitted] main -chunk {0} main.js (main) 0 bytes [rendered] +chunk {0} main.js (main) 0 bytes [entry] [rendered] [0] (webpack)/test/statsCases/color-enabled-custom/index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/color-enabled/expected.txt b/test/statsCases/color-enabled/expected.txt index 56aed58bf2e..21b212fa827 100644 --- a/test/statsCases/color-enabled/expected.txt +++ b/test/statsCases/color-enabled/expected.txt @@ -1,6 +1,6 @@ -Hash: 0fca0b37055d42f98682 +Hash: 6c781fe6bf412ba6435b Time: Xms Asset Size Chunks Chunk Names main.js 2.02 kB 0 [emitted] main -chunk {0} main.js (main) 0 bytes [rendered] +chunk {0} main.js (main) 0 bytes [entry] [rendered] [0] (webpack)/test/statsCases/color-enabled/index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/define-plugin/expected.txt b/test/statsCases/define-plugin/expected.txt index 19ee0b00e4e..d7b337a2bb3 100644 --- a/test/statsCases/define-plugin/expected.txt +++ b/test/statsCases/define-plugin/expected.txt @@ -1,15 +1,15 @@ -Hash: 9874287bb38ab21ad7571557d04931c0902dd6cd +Hash: 052d0451a89cb963e4d3eb3ff8e5a88b9234d04f Child - Hash: 9874287bb38ab21ad757 + Hash: 052d0451a89cb963e4d3 Time: Xms Asset Size Chunks Chunk Names main.js 2.07 kB 0 [emitted] main - chunk {0} main.js (main) 24 bytes [rendered] + chunk {0} main.js (main) 24 bytes [entry] [rendered] [0] (webpack)/test/statsCases/define-plugin/index.js 24 bytes {0} [built] Child - Hash: 1557d04931c0902dd6cd + Hash: eb3ff8e5a88b9234d04f Time: Xms Asset Size Chunks Chunk Names main.js 2.07 kB 0 [emitted] main - chunk {0} main.js (main) 24 bytes [rendered] + chunk {0} main.js (main) 24 bytes [entry] [rendered] [0] (webpack)/test/statsCases/define-plugin/index.js 24 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/external/expected.txt b/test/statsCases/external/expected.txt index 1413b2e7a9a..7fd7f8c52cd 100644 --- a/test/statsCases/external/expected.txt +++ b/test/statsCases/external/expected.txt @@ -1,7 +1,7 @@ -Hash: ea561aa543731a7f84b9 +Hash: 5957a4911072fb217ca1 Time: Xms Asset Size Chunks Chunk Names main.js 2.16 kB 0 [emitted] main -chunk {0} main.js (main) 59 bytes [rendered] - [0] (webpack)/test/statsCases/external/index.js 17 bytes {0} [built] - [1] external "test" 42 bytes {0} [not cacheable] \ No newline at end of file +chunk {0} main.js (main) 59 bytes [entry] [rendered] + [0] external "test" 42 bytes {0} [not cacheable] + [1] (webpack)/test/statsCases/external/index.js 17 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/optimize-chunks/expected.txt b/test/statsCases/optimize-chunks/expected.txt index db2616b00da..f61eda6b9e7 100644 --- a/test/statsCases/optimize-chunks/expected.txt +++ b/test/statsCases/optimize-chunks/expected.txt @@ -1,43 +1,43 @@ -Hash: e3dc693bc52a75b4a39b +Hash: 2c7426d5dd5764a5cfe8 Time: Xms Asset Size Chunks Chunk Names 0.js 244 bytes 0 [emitted] cir1 1.js 212 bytes 1, 2 [emitted] abd 2.js 129 bytes 2 [emitted] ab -main.js 6.01 kB 3 [emitted] main - 4.js 259 bytes 4 [emitted] cir2 - 5.js 136 bytes 5, 7 [emitted] chunk - 6.js 317 bytes 6, 4 [emitted] cir2 from cir1 - 7.js 78 bytes 7 [emitted] ac in ab -chunk {0} 0.js (cir1) 81 bytes {3} {6} {4} [rendered] - > cir1 [7] (webpack)/test/statsCases/optimize-chunks/index.js 13:0-54 + 3.js 259 bytes 3 [emitted] cir2 + 4.js 136 bytes 4, 6 [emitted] chunk + 5.js 317 bytes 5, 3 [emitted] cir2 from cir1 + 6.js 78 bytes 6 [emitted] ac in ab +main.js 6.01 kB 7 [emitted] main +chunk {0} 0.js (cir1) 81 bytes {7} {5} {3} [rendered] > duplicate cir1 from cir2 [3] (webpack)/test/statsCases/optimize-chunks/circular2.js 1:0-79 + > duplicate cir1 [8] (webpack)/test/statsCases/optimize-chunks/index.js 13:0-54 [2] (webpack)/test/statsCases/optimize-chunks/circular1.js 81 bytes {0} [built] -chunk {1} 1.js (abd) 0 bytes {3} [rendered] - > abd [7] (webpack)/test/statsCases/optimize-chunks/index.js 8:0-11:9 +chunk {1} 1.js (abd) 0 bytes {7} [rendered] + > abd [8] (webpack)/test/statsCases/optimize-chunks/index.js 8:0-11:9 [0] (webpack)/test/statsCases/optimize-chunks/modules/a.js 0 bytes {1} {2} [built] [1] (webpack)/test/statsCases/optimize-chunks/modules/b.js 0 bytes {1} {2} [built] - [5] (webpack)/test/statsCases/optimize-chunks/modules/d.js 0 bytes {1} {5} [built] -chunk {2} 2.js (ab) 0 bytes {3} [rendered] - > ab [7] (webpack)/test/statsCases/optimize-chunks/index.js 1:0-6:8 + [5] (webpack)/test/statsCases/optimize-chunks/modules/d.js 0 bytes {1} {4} [built] +chunk {2} 2.js (ab) 0 bytes {7} [rendered] + > ab [8] (webpack)/test/statsCases/optimize-chunks/index.js 1:0-6:8 [0] (webpack)/test/statsCases/optimize-chunks/modules/a.js 0 bytes {1} {2} [built] [1] (webpack)/test/statsCases/optimize-chunks/modules/b.js 0 bytes {1} {2} [built] -chunk {3} main.js (main) 523 bytes [rendered] - > main [7] (webpack)/test/statsCases/optimize-chunks/index.js - [6] (webpack)/test/statsCases/optimize-chunks/modules/f.js 0 bytes {3} [built] - [7] (webpack)/test/statsCases/optimize-chunks/index.js 523 bytes {3} [built] -chunk {4} 4.js (cir2) 81 bytes {3} [rendered] - > cir2 [7] (webpack)/test/statsCases/optimize-chunks/index.js 14:0-54 - [3] (webpack)/test/statsCases/optimize-chunks/circular2.js 81 bytes {4} {6} [built] -chunk {5} 5.js (chunk) 0 bytes {7} {1} [rendered] - > chunk [7] (webpack)/test/statsCases/optimize-chunks/index.js 3:2-4:13 - > chunk [7] (webpack)/test/statsCases/optimize-chunks/index.js 9:1-10:12 - [4] (webpack)/test/statsCases/optimize-chunks/modules/c.js 0 bytes {5} {7} [built] - [5] (webpack)/test/statsCases/optimize-chunks/modules/d.js 0 bytes {1} {5} [built] -chunk {6} 6.js (cir2 from cir1) 81 bytes {0} [rendered] +chunk {3} 3.js (cir2) 81 bytes {7} [rendered] + > cir2 [8] (webpack)/test/statsCases/optimize-chunks/index.js 14:0-54 + [3] (webpack)/test/statsCases/optimize-chunks/circular2.js 81 bytes {3} {5} [built] +chunk {4} 4.js (chunk) 0 bytes {6} {1} [rendered] + > chunk [8] (webpack)/test/statsCases/optimize-chunks/index.js 3:2-4:13 + > chunk [8] (webpack)/test/statsCases/optimize-chunks/index.js 9:1-10:12 + [4] (webpack)/test/statsCases/optimize-chunks/modules/c.js 0 bytes {4} {6} [built] + [5] (webpack)/test/statsCases/optimize-chunks/modules/d.js 0 bytes {1} {4} [built] +chunk {5} 5.js (cir2 from cir1) 81 bytes {0} [rendered] > cir2 from cir1 [2] (webpack)/test/statsCases/optimize-chunks/circular1.js 1:0-79 - [3] (webpack)/test/statsCases/optimize-chunks/circular2.js 81 bytes {4} {6} [built] - [8] (webpack)/test/statsCases/optimize-chunks/modules/e.js 0 bytes {6} [built] -chunk {7} 7.js (ac in ab) 0 bytes {2} [rendered] - > ac in ab [7] (webpack)/test/statsCases/optimize-chunks/index.js 2:1-5:15 - [4] (webpack)/test/statsCases/optimize-chunks/modules/c.js 0 bytes {5} {7} [built] \ No newline at end of file + [3] (webpack)/test/statsCases/optimize-chunks/circular2.js 81 bytes {3} {5} [built] + [7] (webpack)/test/statsCases/optimize-chunks/modules/e.js 0 bytes {5} [built] +chunk {6} 6.js (ac in ab) 0 bytes {2} [rendered] + > ac in ab [8] (webpack)/test/statsCases/optimize-chunks/index.js 2:1-5:15 + [4] (webpack)/test/statsCases/optimize-chunks/modules/c.js 0 bytes {4} {6} [built] +chunk {7} main.js (main) 523 bytes [entry] [rendered] + > main [8] (webpack)/test/statsCases/optimize-chunks/index.js + [6] (webpack)/test/statsCases/optimize-chunks/modules/f.js 0 bytes {7} [built] + [8] (webpack)/test/statsCases/optimize-chunks/index.js 523 bytes {7} [built] \ No newline at end of file diff --git a/test/statsCases/preset-minimal-simple/expected.txt b/test/statsCases/preset-minimal-simple/expected.txt index 6c1906cad74..21bb031a2c4 100644 --- a/test/statsCases/preset-minimal-simple/expected.txt +++ b/test/statsCases/preset-minimal-simple/expected.txt @@ -1 +1 @@ -chunk {0} main.js (main) 0 bytes [rendered] \ No newline at end of file +chunk {0} main.js (main) 0 bytes [entry] [rendered] \ No newline at end of file diff --git a/test/statsCases/preset-minimal/expected.txt b/test/statsCases/preset-minimal/expected.txt index 61a7d564ece..b5228183ea6 100644 --- a/test/statsCases/preset-minimal/expected.txt +++ b/test/statsCases/preset-minimal/expected.txt @@ -1,4 +1,4 @@ -chunk {0} main.js (main) 73 bytes [rendered] -chunk {1} 1.js 54 bytes {0} [rendered] -chunk {2} 2.js 22 bytes {0} [rendered] -chunk {3} 3.js 44 bytes {1} [rendered] \ No newline at end of file +chunk {0} 0.js 54 bytes {3} [rendered] +chunk {1} 1.js 22 bytes {3} [rendered] +chunk {2} 2.js 44 bytes {0} [rendered] +chunk {3} main.js (main) 73 bytes [entry] [rendered] \ No newline at end of file diff --git a/test/statsCases/preset-normal/expected.txt b/test/statsCases/preset-normal/expected.txt index 9a05bf53ee9..5523a8ca041 100644 --- a/test/statsCases/preset-normal/expected.txt +++ b/test/statsCases/preset-normal/expected.txt @@ -1,6 +1,6 @@ -Hash: 8ca45b6d16d1f1e8be32 +Hash: 85e57db9faf6765d1cf0 Time: Xms -chunk {0} main.js (main) 73 bytes [rendered] -chunk {1} 1.js 54 bytes {0} [rendered] -chunk {2} 2.js 22 bytes {0} [rendered] -chunk {3} 3.js 44 bytes {1} [rendered] \ No newline at end of file +chunk {0} 0.js 54 bytes {3} [rendered] +chunk {1} 1.js 22 bytes {3} [rendered] +chunk {2} 2.js 44 bytes {0} [rendered] +chunk {3} main.js (main) 73 bytes [entry] [rendered] \ No newline at end of file diff --git a/test/statsCases/preset-verbose/expected.txt b/test/statsCases/preset-verbose/expected.txt index 122a01a070f..d95da181de4 100644 --- a/test/statsCases/preset-verbose/expected.txt +++ b/test/statsCases/preset-verbose/expected.txt @@ -1,28 +1,29 @@ -Hash: 8ca45b6d16d1f1e8be32 +Hash: 85e57db9faf6765d1cf0 Time: Xms Asset Size Chunks Chunk Names -main.js 5.28 kB 0 [emitted] main - 1.js 251 bytes 1 [emitted] - 2.js 106 bytes 2 [emitted] - 3.js 200 bytes 3 [emitted] -chunk {0} main.js (main) 73 bytes [rendered] - [0] (webpack)/test/statsCases/preset-verbose/a.js 22 bytes {0} [built] - cjs require ./a [5] (webpack)/test/statsCases/preset-verbose/index.js 1:0-14 - [] -> factory:Xms building:Xms = Xms - [5] (webpack)/test/statsCases/preset-verbose/index.js 51 bytes {0} [built] - factory:Xms building:Xms = Xms -chunk {1} 1.js 54 bytes {0} [rendered] - [2] (webpack)/test/statsCases/preset-verbose/c.js 54 bytes {1} [built] + 0.js 251 bytes 0 [emitted] + 1.js 106 bytes 1 [emitted] + 2.js 200 bytes 2 [emitted] +main.js 5.28 kB 3 [emitted] main +Entrypoint main = main.js +chunk {0} 0.js 54 bytes {3} [rendered] + [2] (webpack)/test/statsCases/preset-verbose/c.js 54 bytes {0} [built] amd require ./c [5] (webpack)/test/statsCases/preset-verbose/index.js 3:0-16 [] -> factory:Xms building:Xms = Xms -chunk {2} 2.js 22 bytes {0} [rendered] - [1] (webpack)/test/statsCases/preset-verbose/b.js 22 bytes {2} [built] +chunk {1} 1.js 22 bytes {3} [rendered] + [1] (webpack)/test/statsCases/preset-verbose/b.js 22 bytes {1} [built] amd require ./b [5] (webpack)/test/statsCases/preset-verbose/index.js 2:0-16 [] -> factory:Xms building:Xms = Xms -chunk {3} 3.js 44 bytes {1} [rendered] - [3] (webpack)/test/statsCases/preset-verbose/d.js 22 bytes {3} [built] +chunk {2} 2.js 44 bytes {0} [rendered] + [3] (webpack)/test/statsCases/preset-verbose/d.js 22 bytes {2} [built] require.ensure item ./d [2] (webpack)/test/statsCases/preset-verbose/c.js 1:0-52 [] -> factory:Xms building:Xms = Xms - [4] (webpack)/test/statsCases/preset-verbose/e.js 22 bytes {3} [built] + [4] (webpack)/test/statsCases/preset-verbose/e.js 22 bytes {2} [built] require.ensure item ./e [2] (webpack)/test/statsCases/preset-verbose/c.js 1:0-52 - [] -> factory:Xms building:Xms = Xms \ No newline at end of file + [] -> factory:Xms building:Xms = Xms +chunk {3} main.js (main) 73 bytes [entry] [rendered] + [0] (webpack)/test/statsCases/preset-verbose/a.js 22 bytes {3} [built] + cjs require ./a [5] (webpack)/test/statsCases/preset-verbose/index.js 1:0-14 + [] -> factory:Xms building:Xms = Xms + [5] (webpack)/test/statsCases/preset-verbose/index.js 51 bytes {3} [built] + factory:Xms building:Xms = Xms \ No newline at end of file diff --git a/test/statsCases/simple-more-info/expected.txt b/test/statsCases/simple-more-info/expected.txt index ff6379091f9..bdb6b5fcd5b 100644 --- a/test/statsCases/simple-more-info/expected.txt +++ b/test/statsCases/simple-more-info/expected.txt @@ -1,8 +1,8 @@ -Hash: b85ca8f6c28cbbc3320d +Hash: 0bd4f09244f0e8c60354 Time: Xms Asset Size Chunks Chunk Names bundle.js 2.02 kB 0 [emitted] main -chunk {0} bundle.js (main) 0 bytes [rendered] +chunk {0} bundle.js (main) 0 bytes [entry] [rendered] > main [0] (webpack)/test/statsCases/simple-more-info/index.js [0] (webpack)/test/statsCases/simple-more-info/index.js 0 bytes {0} [built] factory:Xms building:Xms = Xms diff --git a/test/statsCases/simple/expected.txt b/test/statsCases/simple/expected.txt index a82fdadfa19..62b4a2304d7 100644 --- a/test/statsCases/simple/expected.txt +++ b/test/statsCases/simple/expected.txt @@ -1,6 +1,6 @@ -Hash: b85ca8f6c28cbbc3320d +Hash: 0bd4f09244f0e8c60354 Time: Xms Asset Size Chunks Chunk Names bundle.js 2.02 kB 0 [emitted] main -chunk {0} bundle.js (main) 0 bytes [rendered] +chunk {0} bundle.js (main) 0 bytes [entry] [rendered] [0] (webpack)/test/statsCases/simple/index.js 0 bytes {0} [built] \ No newline at end of file