webpack 2.1.0-beta.21 → 2.1.0-beta.25
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/bin/config-yargs.js +6 -5
- package/bin/convert-argv.js +59 -31
- package/bin/webpack.js +30 -2
- package/lib/APIPlugin.js +19 -16
- package/lib/Chunk.js +1 -1
- package/lib/CommonJsHarmonyMainTemplatePlugin.js +21 -0
- package/lib/CompatibilityPlugin.js +24 -17
- package/lib/Compilation.js +36 -15
- package/lib/Compiler.js +48 -15
- package/lib/ConstPlugin.js +40 -37
- package/lib/DefinePlugin.js +107 -103
- package/lib/DelegatedModule.js +1 -2
- package/lib/Dependency.js +5 -0
- package/lib/DllReferencePlugin.js +41 -15
- package/lib/ExtendedAPIPlugin.js +14 -11
- package/lib/FlagDependencyExportsPlugin.js +102 -0
- package/lib/FlagInitialModulesAsUsedPlugin.js +23 -23
- package/lib/FunctionModuleTemplatePlugin.js +4 -0
- package/lib/HotModuleReplacement.runtime.js +1 -1
- package/lib/HotModuleReplacementPlugin.js +71 -68
- package/lib/LibManifestPlugin.js +1 -2
- package/lib/LibraryTemplatePlugin.js +4 -0
- package/lib/MainTemplate.js +12 -13
- package/lib/Module.js +10 -1
- package/lib/MovedToPluginWarningPlugin.js +3 -1
- package/lib/MultiCompiler.js +81 -7
- package/lib/NodeStuffPlugin.js +97 -86
- package/lib/NormalModule.js +6 -0
- package/lib/NormalModuleFactory.js +87 -34
- package/lib/Parser.js +13 -4
- package/lib/ProvidePlugin.js +30 -27
- package/lib/RequireJsStuffPlugin.js +27 -21
- package/lib/RuleSet.js +369 -0
- package/lib/Stats.js +74 -90
- package/lib/UseStrictPlugin.js +12 -8
- package/lib/WebpackOptionsApply.js +3 -13
- package/lib/WebpackOptionsDefaulter.js +0 -1
- package/lib/WebpackOptionsValidationError.js +186 -0
- package/lib/dependencies/AMDPlugin.js +64 -55
- package/lib/dependencies/CommonJsPlugin.js +55 -45
- package/lib/dependencies/HarmonyExportExpressionDependency.js +6 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +76 -16
- package/lib/dependencies/HarmonyExportSpecifierDependency.js +12 -4
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +6 -4
- package/lib/dependencies/HarmonyModulesHelpers.js +0 -29
- package/lib/dependencies/HarmonyModulesPlugin.js +11 -4
- package/lib/dependencies/RequireContextPlugin.js +12 -5
- package/lib/dependencies/RequireEnsurePlugin.js +17 -10
- package/lib/dependencies/RequireIncludePlugin.js +18 -10
- package/lib/dependencies/SystemPlugin.js +48 -29
- package/lib/node/NodeMainTemplate.runtime.js +2 -2
- package/lib/node/NodeMainTemplateAsync.runtime.js +2 -2
- package/lib/node/NodeSourcePlugin.js +84 -71
- package/lib/optimize/ChunkModuleIdRangePlugin.js +52 -0
- package/lib/optimize/EnsureChunkConditionsPlugin.js +7 -2
- package/lib/validateWebpackOptions.js +63 -0
- package/lib/webpack.js +9 -6
- package/lib/webworker/WebWorkerMainTemplate.runtime.js +35 -33
- package/package.json +13 -8
- package/schemas/webpackOptionsSchema.json +802 -0
- package/README.md +0 -315
- package/lib/LoadersList.js +0 -110
- package/lib/dependencies/LabeledExportsDependency.js +0 -21
- package/lib/dependencies/LabeledModuleDependency.js +0 -36
- package/lib/dependencies/LabeledModuleDependencyParserPlugin.js +0 -78
- package/lib/dependencies/LabeledModulesPlugin.js +0 -26
@@ -2,7 +2,7 @@
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
3
|
Author Tobias Koppers @sokra
|
4
4
|
*/
|
5
|
-
/*globals hotAddUpdateChunk parentHotUpdateCallback importScripts XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ */
|
5
|
+
/*globals installedChunks hotAddUpdateChunk parentHotUpdateCallback importScripts XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ */
|
6
6
|
module.exports = function() {
|
7
7
|
function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
|
8
8
|
hotAddUpdateChunk(chunkId, moreModules);
|
@@ -14,42 +14,44 @@ module.exports = function() {
|
|
14
14
|
}
|
15
15
|
|
16
16
|
function hotDownloadManifest(callback) { // eslint-disable-line no-unused-vars
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
17
|
+
return new Promise(function(resolve, reject) {
|
18
|
+
if(typeof XMLHttpRequest === "undefined")
|
19
|
+
return reject(new Error("No browser support"));
|
20
|
+
try {
|
21
|
+
var request = new XMLHttpRequest();
|
22
|
+
var requestPath = $require$.p + $hotMainFilename$;
|
23
|
+
request.open("GET", requestPath, true);
|
24
|
+
request.timeout = 10000;
|
25
|
+
request.send(null);
|
26
|
+
} catch(err) {
|
27
|
+
return reject(err);
|
28
|
+
}
|
29
|
+
request.onreadystatechange = function() {
|
30
|
+
if(request.readyState !== 4) return;
|
31
|
+
if(request.status === 0) {
|
32
|
+
// timeout
|
33
|
+
reject(new Error("Manifest request to " + requestPath + " timed out."));
|
34
|
+
} else if(request.status === 404) {
|
35
|
+
// no update available
|
36
|
+
resolve();
|
37
|
+
} else if(request.status !== 200 && request.status !== 304) {
|
38
|
+
// other failure
|
39
|
+
reject(new Error("Manifest request to " + requestPath + " failed."));
|
40
|
+
} else {
|
41
|
+
// success
|
42
|
+
try {
|
43
|
+
var update = JSON.parse(request.responseText);
|
44
|
+
} catch(e) {
|
45
|
+
reject(e);
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
resolve(update);
|
46
49
|
}
|
47
|
-
callback(null, update);
|
48
50
|
}
|
49
|
-
};
|
51
|
+
});
|
50
52
|
}
|
51
53
|
|
52
|
-
function
|
54
|
+
function hotDisposeChunk(chunkId) {
|
53
55
|
delete installedChunks[chunkId];
|
54
56
|
}
|
55
57
|
};
|
package/package.json
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "2.1.0-beta.
|
3
|
+
"version": "2.1.0-beta.25",
|
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": {
|
7
7
|
"acorn": "^3.2.0",
|
8
|
+
"ajv": "^4.7.0",
|
8
9
|
"async": "^1.3.0",
|
9
10
|
"clone": "^1.0.2",
|
10
11
|
"enhanced-resolve": "^2.2.0",
|
11
12
|
"interpret": "^1.0.0",
|
12
|
-
"loader-runner": "^2.
|
13
|
+
"loader-runner": "^2.2.0",
|
13
14
|
"loader-utils": "^0.2.11",
|
14
15
|
"memory-fs": "~0.3.0",
|
15
16
|
"mkdirp": "~0.5.0",
|
@@ -18,7 +19,7 @@
|
|
18
19
|
"source-map": "^0.5.3",
|
19
20
|
"supports-color": "^3.1.0",
|
20
21
|
"tapable": "~0.2.3",
|
21
|
-
"uglify-js": "~2.
|
22
|
+
"uglify-js": "~2.7.3",
|
22
23
|
"watchpack": "^1.0.0",
|
23
24
|
"webpack-sources": "^0.1.0",
|
24
25
|
"yargs": "^4.7.1"
|
@@ -34,6 +35,7 @@
|
|
34
35
|
"coveralls": "^2.11.2",
|
35
36
|
"css-loader": "~0.23.1",
|
36
37
|
"diff": "^2.0.2",
|
38
|
+
"eclint": "^1.1.5",
|
37
39
|
"es6-promise-polyfill": "^1.1.1",
|
38
40
|
"eslint": "^1.1.0",
|
39
41
|
"express": "~4.13.1",
|
@@ -78,19 +80,22 @@
|
|
78
80
|
"bin/",
|
79
81
|
"buildin/",
|
80
82
|
"hot/",
|
81
|
-
"web_modules/"
|
83
|
+
"web_modules/",
|
84
|
+
"schemas/"
|
82
85
|
],
|
83
86
|
"scripts": {
|
84
|
-
"pretest": "npm run lint && npm run beautify-lint",
|
85
87
|
"test": "mocha --harmony --full-trace --check-leaks",
|
86
88
|
"travis": "npm run cover -- --report lcovonly",
|
87
89
|
"appveyor": "mocha --harmony --full-trace",
|
90
|
+
"pretest": "npm run lint-files",
|
91
|
+
"postcover": "npm run lint-files && npm run nsp",
|
92
|
+
"lint-files": "npm run lint && npm run beautify-lint && npm run lint-file-standard",
|
88
93
|
"lint": "eslint lib bin hot",
|
89
|
-
"
|
94
|
+
"lint-file-standard": "eclint check lib/**/*.js hot/*.js bin/*.js benchmark/*.js test/*.js",
|
90
95
|
"beautify-lint": "beautify-lint lib/**/*.js hot/**/*.js bin/**/*.js benchmark/*.js test/*.js",
|
96
|
+
"nsp": "nsp check --output summary",
|
97
|
+
"cover": "istanbul cover -x '**/*.runtime.js' node_modules/mocha/bin/_mocha",
|
91
98
|
"beautify": "beautify-rewrite lib/**/*.js hot/**/*.js bin/**/*.js benchmark/*.js test/*.js",
|
92
|
-
"postcover": "npm run lint && npm run beautify-lint && npm run nsp",
|
93
|
-
"cover": "istanbul cover -x *.runtime.js node_modules/mocha/bin/_mocha",
|
94
99
|
"publish-patch": "npm run lint && npm run beautify-lint && mocha && npm version patch && git push && git push --tags && npm publish"
|
95
100
|
}
|
96
101
|
}
|