webpack 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -63
- package/lib/APIPlugin.js +2 -8
- package/lib/AsyncDependenciesBlock.js +46 -55
- package/lib/ChunkTemplate.js +25 -26
- package/lib/CompatibilityPlugin.js +49 -46
- package/lib/Compilation.js +279 -138
- package/lib/ConstPlugin.js +2 -6
- package/lib/DefinePlugin.js +9 -27
- package/lib/EnvironmentPlugin.js +25 -9
- package/lib/EvalDevToolModulePlugin.js +15 -10
- package/lib/EvalSourceMapDevToolPlugin.js +24 -18
- package/lib/ExtendedAPIPlugin.js +1 -6
- package/lib/FlagDependencyExportsPlugin.js +72 -79
- package/lib/FlagInitialModulesAsUsedPlugin.js +17 -13
- package/lib/FunctionModulePlugin.js +17 -11
- package/lib/HotModuleReplacementPlugin.js +3 -13
- package/lib/HotUpdateChunkTemplate.js +21 -22
- package/lib/JsonpTemplatePlugin.js +15 -11
- package/lib/LoaderTargetPlugin.js +14 -10
- package/lib/MainTemplate.js +193 -191
- package/lib/MultiWatching.js +16 -14
- package/lib/NoEmitOnErrorsPlugin.js +14 -11
- package/lib/NodeStuffPlugin.js +6 -30
- package/lib/NormalModuleFactory.js +2 -2
- package/lib/NormalModuleReplacementPlugin.js +36 -31
- package/lib/Parser.js +8 -7
- package/lib/ParserHelpers.js +19 -5
- package/lib/ProvidePlugin.js +2 -6
- package/lib/RequestShortener.js +49 -47
- package/lib/RequireJsStuffPlugin.js +5 -20
- package/lib/RuleSet.js +28 -20
- package/lib/Template.js +133 -132
- package/lib/compareLocations.js +9 -8
- package/lib/dependencies/AMDPlugin.js +111 -115
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +157 -154
- package/lib/dependencies/CommonJsPlugin.js +81 -85
- package/lib/dependencies/CommonJsRequireDependencyParserPlugin.js +73 -75
- package/lib/dependencies/ContextDependencyTemplateAsId.js +21 -18
- package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +23 -29
- package/lib/dependencies/CriticalDependencyWarning.js +13 -8
- package/lib/dependencies/{HarmonyCompatiblilityDependency.js → HarmonyCompatibilityDependency.js} +3 -3
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +2 -2
- package/lib/dependencies/HarmonyModulesPlugin.js +51 -49
- package/lib/dependencies/ImportParserPlugin.js +31 -28
- package/lib/dependencies/ImportPlugin.js +28 -24
- package/lib/dependencies/LocalModule.js +17 -13
- package/lib/dependencies/ModuleDependencyTemplateAsId.js +15 -17
- package/lib/dependencies/ModuleDependencyTemplateAsRequireId.js +15 -17
- package/lib/dependencies/RequireContextPlugin.js +59 -57
- package/lib/dependencies/RequireEnsurePlugin.js +22 -26
- package/lib/dependencies/RequireIncludePlugin.js +18 -23
- package/lib/dependencies/RequireResolveDependencyParserPlugin.js +59 -56
- package/lib/dependencies/SystemPlugin.js +34 -36
- package/lib/dependencies/WebpackMissingModule.js +10 -18
- package/lib/node/NodeTargetPlugin.js +8 -5
- package/lib/node/NodeWatchFileSystem.js +54 -53
- package/lib/optimize/CommonsChunkPlugin.js +163 -166
- package/lib/optimize/RemoveParentModulesPlugin.js +36 -27
- package/lib/validateSchema.js +18 -18
- package/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin.js +22 -20
- package/package.json +12 -6
@@ -2,25 +2,27 @@
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
3
|
Author Tobias Koppers @sokra
|
4
4
|
*/
|
5
|
-
|
6
|
-
|
5
|
+
"use strict";
|
6
|
+
const ConcatSource = require("webpack-sources").ConcatSource;
|
7
|
+
const Template = require("../Template");
|
7
8
|
|
8
|
-
|
9
|
-
module.exports = WebWorkerHotUpdateChunkTemplatePlugin;
|
9
|
+
class WebWorkerHotUpdateChunkTemplatePlugin {
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
}
|
11
|
+
apply(hotUpdateChunkTemplate) {
|
12
|
+
hotUpdateChunkTemplate.plugin("render", function(modulesSource, modules, removedModules, hash, id) {
|
13
|
+
const chunkCallbackName = this.outputOptions.hotUpdateFunction || Template.toIdentifier("webpackHotUpdate" + (this.outputOptions.library || ""));
|
14
|
+
const source = new ConcatSource();
|
15
|
+
source.add(chunkCallbackName + "(" + JSON.stringify(id) + ",");
|
16
|
+
source.add(modulesSource);
|
17
|
+
source.add(")");
|
18
|
+
return source;
|
19
|
+
});
|
20
|
+
hotUpdateChunkTemplate.plugin("hash", function(hash) {
|
21
|
+
hash.update("WebWorkerHotUpdateChunkTemplatePlugin");
|
22
|
+
hash.update("3");
|
23
|
+
hash.update(this.outputOptions.hotUpdateFunction + "");
|
24
|
+
hash.update(this.outputOptions.library + "");
|
25
|
+
});
|
26
|
+
}
|
27
|
+
}
|
28
|
+
module.exports = WebWorkerHotUpdateChunkTemplatePlugin;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "2.2.
|
3
|
+
"version": "2.2.1",
|
4
4
|
"author": "Tobias Koppers @sokra",
|
5
5
|
"description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
|
6
6
|
"dependencies": {
|
@@ -12,7 +12,7 @@
|
|
12
12
|
"enhanced-resolve": "^3.0.0",
|
13
13
|
"interpret": "^1.0.0",
|
14
14
|
"json-loader": "^0.5.4",
|
15
|
-
"loader-runner": "^2.
|
15
|
+
"loader-runner": "^2.3.0",
|
16
16
|
"loader-utils": "^0.2.16",
|
17
17
|
"memory-fs": "~0.4.1",
|
18
18
|
"mkdirp": "~0.5.0",
|
@@ -48,6 +48,7 @@
|
|
48
48
|
"js-beautify": "^1.5.10",
|
49
49
|
"less": "^2.5.1",
|
50
50
|
"less-loader": "^2.0.0",
|
51
|
+
"lodash": "^4.17.4",
|
51
52
|
"mocha": "^3.2.0",
|
52
53
|
"mocha-lcov-reporter": "^1.0.0",
|
53
54
|
"nsp": "^2.6.1",
|
@@ -56,6 +57,7 @@
|
|
56
57
|
"react-dom": "^15.2.1",
|
57
58
|
"script-loader": "~0.7.0",
|
58
59
|
"should": "^11.1.1",
|
60
|
+
"simple-git": "^1.65.0",
|
59
61
|
"sinon": "^1.17.7",
|
60
62
|
"style-loader": "~0.13.0",
|
61
63
|
"url-loader": "~0.5.0",
|
@@ -84,17 +86,21 @@
|
|
84
86
|
"schemas/"
|
85
87
|
],
|
86
88
|
"scripts": {
|
87
|
-
"test": "mocha --harmony --check-leaks",
|
88
|
-
"travis:test": "npm run cover
|
89
|
+
"test": "mocha test/*.test.js --harmony --check-leaks",
|
90
|
+
"travis:test": "npm run cover:min",
|
89
91
|
"travis:lint": "npm run lint-files && npm run nsp",
|
90
|
-
"
|
92
|
+
"travis:benchmark": "npm run benchmark",
|
93
|
+
"appveyor:test": "node --max_old_space_size=4096 node_modules\\mocha\\bin\\mocha --harmony test/*.test.js",
|
94
|
+
"appveyor:benchmark": "npm run benchmark",
|
91
95
|
"build:examples": "cd examples && node buildAll.js",
|
92
96
|
"pretest": "npm run lint-files",
|
93
97
|
"lint-files": "npm run lint && npm run beautify-lint",
|
94
98
|
"lint": "eslint lib bin hot buildin test/**/webpack.config.js test/binCases/**/test.js examples/**/webpack.config.js",
|
95
99
|
"beautify-lint": "beautify-lint 'lib/**/*.js' 'hot/**/*.js' 'bin/**/*.js' 'benchmark/*.js' 'test/*.js'",
|
96
100
|
"nsp": "nsp check --output summary",
|
97
|
-
"
|
101
|
+
"benchmark": "mocha test/*.benchmark.js --harmony -R spec",
|
102
|
+
"cover": "node --harmony ./node_modules/istanbul/lib/cli.js cover -x '**/*.runtime.js' node_modules/mocha/bin/_mocha -- test/*.test.js",
|
103
|
+
"cover:min": "node --harmony ./node_modules/.bin/istanbul cover -x '**/*.runtime.js' --report lcovonly node_modules/mocha/bin/_mocha -- test/*.test.js",
|
98
104
|
"publish-patch": "npm run lint && npm run beautify-lint && mocha && npm version patch && git push && git push --tags && npm publish"
|
99
105
|
}
|
100
106
|
}
|