webpack 4.16.0 → 4.16.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/LICENSE +20 -20
- package/README.md +5 -2
- package/buildin/amd-define.js +3 -3
- package/buildin/amd-options.js +2 -2
- package/buildin/system.js +7 -7
- package/hot/emitter.js +2 -2
- package/lib/Compilation.js +1 -0
- package/lib/DefinePlugin.js +49 -0
- package/lib/MemoryOutputFileSystem.js +5 -5
- package/lib/NullFactory.js +12 -12
- package/lib/OptionsApply.js +10 -10
- package/lib/dependencies/AMDRequireItemDependency.js +22 -22
- package/lib/dependencies/CommonJsRequireDependency.js +22 -22
- package/lib/dependencies/CriticalDependencyWarning.js +20 -20
- package/lib/dependencies/DelegatedSourceDependency.js +18 -18
- package/lib/dependencies/DllEntryDependency.js +20 -20
- package/lib/dependencies/LocalModule.js +23 -23
- package/lib/dependencies/ModuleHotAcceptDependency.js +23 -23
- package/lib/dependencies/ModuleHotDeclineDependency.js +23 -23
- package/lib/dependencies/PrefetchDependency.js +18 -18
- package/lib/dependencies/RequireEnsureItemDependency.js +21 -21
- package/lib/dependencies/RequireResolveDependency.js +22 -22
- package/lib/node/NodeOutputFileSystem.js +22 -22
- package/lib/optimize/OccurrenceChunkOrderPlugin.js +1 -1
- package/lib/optimize/OccurrenceModuleOrderPlugin.js +1 -1
- package/lib/optimize/OccurrenceOrderPlugin.js +2 -2
- package/package.json +7 -7
- package/schemas/WebpackOptions.json +2 -6
package/LICENSE
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright JS Foundation and other contributors
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
'Software'), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright JS Foundation and other contributors
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
'Software'), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
@@ -92,16 +92,19 @@ within webpack itself use this plugin interface. This makes webpack very
|
|
92
92
|
|
93
93
|
|Name|Status|Install Size|Description|
|
94
94
|
|:--:|:----:|:----------:|:----------|
|
95
|
-
|[
|
95
|
+
|[mini-css-extract-plugin][mini-css]|![mini-css-npm]|![mini-css-size]|Extracts CSS into separate files. It creates a CSS file per JS file which contains CSS.|
|
96
96
|
|[compression-webpack-plugin][compression]|![compression-npm]|![compression-size]|Prepares compressed versions of assets to serve them with Content-Encoding|
|
97
97
|
|[i18n-webpack-plugin][i18n]|![i18n-npm]|![i18n-size]|Adds i18n support to your bundles|
|
98
98
|
|[html-webpack-plugin][html-plugin]|![html-plugin-npm]|![html-plugin-size]| Simplifies creation of HTML files (`index.html`) to serve your bundles|
|
99
|
-
|
99
|
+
|[extract-text-webpack-plugin][extract]|![extract-npm]|![extract-size]|Extract text from a bundle, or bundles, into a separate file|
|
100
100
|
|
101
101
|
[common-npm]: https://img.shields.io/npm/v/webpack.svg
|
102
102
|
[extract]: https://github.com/webpack/extract-text-webpack-plugin
|
103
103
|
[extract-npm]: https://img.shields.io/npm/v/extract-text-webpack-plugin.svg
|
104
104
|
[extract-size]: https://packagephobia.now.sh/badge?p=extract-text-webpack-plugin
|
105
|
+
[mini-css]: https://github.com/webpack-contrib/mini-css-extract-plugin
|
106
|
+
[mini-css-npm]: https://img.shields.io/npm/v/mini-css-extract-plugin.svg
|
107
|
+
[mini-css-size]: https://packagephobia.now.sh/badge?p=mini-css-extract-plugin
|
105
108
|
[component]: https://github.com/webpack/component-webpack-plugin
|
106
109
|
[component-npm]: https://img.shields.io/npm/v/component-webpack-plugin.svg
|
107
110
|
[component-size]: https://packagephobia.now.sh/badge?p=component-webpack-plugin
|
package/buildin/amd-define.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module.exports = function() {
|
2
|
-
throw new Error("define cannot be used indirect");
|
3
|
-
};
|
1
|
+
module.exports = function() {
|
2
|
+
throw new Error("define cannot be used indirect");
|
3
|
+
};
|
package/buildin/amd-options.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
/* globals __webpack_amd_options__ */
|
2
|
-
module.exports = __webpack_amd_options__;
|
1
|
+
/* globals __webpack_amd_options__ */
|
2
|
+
module.exports = __webpack_amd_options__;
|
package/buildin/system.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
// Provide a "System" global.
|
2
|
-
module.exports = {
|
3
|
-
// Make sure import is only used as "System.import"
|
4
|
-
import: function() {
|
5
|
-
throw new Error("System.import cannot be used indirectly");
|
6
|
-
}
|
7
|
-
};
|
1
|
+
// Provide a "System" global.
|
2
|
+
module.exports = {
|
3
|
+
// Make sure import is only used as "System.import"
|
4
|
+
import: function() {
|
5
|
+
throw new Error("System.import cannot be used indirectly");
|
6
|
+
}
|
7
|
+
};
|
package/hot/emitter.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
var EventEmitter = require("events");
|
2
|
-
module.exports = new EventEmitter();
|
1
|
+
var EventEmitter = require("events");
|
2
|
+
module.exports = new EventEmitter();
|
package/lib/Compilation.js
CHANGED
package/lib/DefinePlugin.js
CHANGED
@@ -9,6 +9,11 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
|
9
9
|
const ParserHelpers = require("./ParserHelpers");
|
10
10
|
const NullFactory = require("./NullFactory");
|
11
11
|
|
12
|
+
/** @typedef {import("./Compiler")} Compiler */
|
13
|
+
/** @typedef {import("./Parser")} Parser */
|
14
|
+
/** @typedef {null|undefined|RegExp|Function|string|number} CodeValuePrimitive */
|
15
|
+
/** @typedef {CodeValuePrimitive|Record<string, CodeValuePrimitive>|RuntimeValue} CodeValue */
|
16
|
+
|
12
17
|
class RuntimeValue {
|
13
18
|
constructor(fn, fileDependencies) {
|
14
19
|
this.fn = fn;
|
@@ -37,6 +42,12 @@ const stringifyObj = (obj, parser) => {
|
|
37
42
|
);
|
38
43
|
};
|
39
44
|
|
45
|
+
/**
|
46
|
+
* Convert code to a string that evaluates
|
47
|
+
* @param {CodeValue} code Code to evaluate
|
48
|
+
* @param {Parser} parser Parser
|
49
|
+
* @returns {string} code converted to string that evaluates
|
50
|
+
*/
|
40
51
|
const toCode = (code, parser) => {
|
41
52
|
if (code === null) {
|
42
53
|
return "null";
|
@@ -60,6 +71,10 @@ const toCode = (code, parser) => {
|
|
60
71
|
};
|
61
72
|
|
62
73
|
class DefinePlugin {
|
74
|
+
/**
|
75
|
+
* Create a new define plugin
|
76
|
+
* @param {Record<string, CodeValue>} definitions A map of global object definitions
|
77
|
+
*/
|
63
78
|
constructor(definitions) {
|
64
79
|
this.definitions = definitions;
|
65
80
|
}
|
@@ -68,6 +83,11 @@ class DefinePlugin {
|
|
68
83
|
return new RuntimeValue(fn, fileDependencies);
|
69
84
|
}
|
70
85
|
|
86
|
+
/**
|
87
|
+
* Apply the plugin
|
88
|
+
* @param {Compiler} compiler Webpack compiler
|
89
|
+
* @returns {void}
|
90
|
+
*/
|
71
91
|
apply(compiler) {
|
72
92
|
const definitions = this.definitions;
|
73
93
|
compiler.hooks.compilation.tap(
|
@@ -79,7 +99,18 @@ class DefinePlugin {
|
|
79
99
|
new ConstDependency.Template()
|
80
100
|
);
|
81
101
|
|
102
|
+
/**
|
103
|
+
* Handler
|
104
|
+
* @param {Parser} parser Parser
|
105
|
+
* @returns {void}
|
106
|
+
*/
|
82
107
|
const handler = parser => {
|
108
|
+
/**
|
109
|
+
* Walk definitions
|
110
|
+
* @param {Object} definitions Definitions map
|
111
|
+
* @param {string} prefix Prefix string
|
112
|
+
* @returns {void}
|
113
|
+
*/
|
83
114
|
const walkDefinitions = (definitions, prefix) => {
|
84
115
|
Object.keys(definitions).forEach(key => {
|
85
116
|
const code = definitions[key];
|
@@ -98,6 +129,12 @@ class DefinePlugin {
|
|
98
129
|
});
|
99
130
|
};
|
100
131
|
|
132
|
+
/**
|
133
|
+
* Apply define key
|
134
|
+
* @param {string} prefix Prefix
|
135
|
+
* @param {string} key Key
|
136
|
+
* @returns {void}
|
137
|
+
*/
|
101
138
|
const applyDefineKey = (prefix, key) => {
|
102
139
|
const splittedKey = key.split(".");
|
103
140
|
splittedKey.slice(1).forEach((_, i) => {
|
@@ -108,6 +145,12 @@ class DefinePlugin {
|
|
108
145
|
});
|
109
146
|
};
|
110
147
|
|
148
|
+
/**
|
149
|
+
* Apply Code
|
150
|
+
* @param {string} key Key
|
151
|
+
* @param {CodeValue} code Code
|
152
|
+
* @returns {void}
|
153
|
+
*/
|
111
154
|
const applyDefine = (key, code) => {
|
112
155
|
const isTypeof = /^typeof\s+/.test(key);
|
113
156
|
if (isTypeof) key = key.replace(/^typeof\s+/, "");
|
@@ -181,6 +224,12 @@ class DefinePlugin {
|
|
181
224
|
});
|
182
225
|
};
|
183
226
|
|
227
|
+
/**
|
228
|
+
* Apply Object
|
229
|
+
* @param {string} key Key
|
230
|
+
* @param {Object} obj Object
|
231
|
+
* @returns {void}
|
232
|
+
*/
|
184
233
|
const applyObjectDefine = (key, obj) => {
|
185
234
|
parser.hooks.canRename
|
186
235
|
.for(key)
|
@@ -1,5 +1,5 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
module.exports = require("memory-fs");
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
module.exports = require("memory-fs");
|
package/lib/NullFactory.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
class NullFactory {
|
8
|
-
create(data, callback) {
|
9
|
-
return callback();
|
10
|
-
}
|
11
|
-
}
|
12
|
-
module.exports = NullFactory;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
class NullFactory {
|
8
|
+
create(data, callback) {
|
9
|
+
return callback();
|
10
|
+
}
|
11
|
+
}
|
12
|
+
module.exports = NullFactory;
|
package/lib/OptionsApply.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
class OptionsApply {
|
8
|
-
process(options, compiler) {}
|
9
|
-
}
|
10
|
-
module.exports = OptionsApply;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
class OptionsApply {
|
8
|
+
process(options, compiler) {}
|
9
|
+
}
|
10
|
+
module.exports = OptionsApply;
|
@@ -1,22 +1,22 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
const ModuleDependencyTemplateAsRequireId = require("./ModuleDependencyTemplateAsRequireId");
|
8
|
-
|
9
|
-
class AMDRequireItemDependency extends ModuleDependency {
|
10
|
-
constructor(request, range) {
|
11
|
-
super(request);
|
12
|
-
this.range = range;
|
13
|
-
}
|
14
|
-
|
15
|
-
get type() {
|
16
|
-
return "amd require";
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
AMDRequireItemDependency.Template = ModuleDependencyTemplateAsRequireId;
|
21
|
-
|
22
|
-
module.exports = AMDRequireItemDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
const ModuleDependencyTemplateAsRequireId = require("./ModuleDependencyTemplateAsRequireId");
|
8
|
+
|
9
|
+
class AMDRequireItemDependency extends ModuleDependency {
|
10
|
+
constructor(request, range) {
|
11
|
+
super(request);
|
12
|
+
this.range = range;
|
13
|
+
}
|
14
|
+
|
15
|
+
get type() {
|
16
|
+
return "amd require";
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
AMDRequireItemDependency.Template = ModuleDependencyTemplateAsRequireId;
|
21
|
+
|
22
|
+
module.exports = AMDRequireItemDependency;
|
@@ -1,22 +1,22 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
|
8
|
-
|
9
|
-
class CommonJsRequireDependency extends ModuleDependency {
|
10
|
-
constructor(request, range) {
|
11
|
-
super(request);
|
12
|
-
this.range = range;
|
13
|
-
}
|
14
|
-
|
15
|
-
get type() {
|
16
|
-
return "cjs require";
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
CommonJsRequireDependency.Template = ModuleDependencyTemplateAsId;
|
21
|
-
|
22
|
-
module.exports = CommonJsRequireDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
|
8
|
+
|
9
|
+
class CommonJsRequireDependency extends ModuleDependency {
|
10
|
+
constructor(request, range) {
|
11
|
+
super(request);
|
12
|
+
this.range = range;
|
13
|
+
}
|
14
|
+
|
15
|
+
get type() {
|
16
|
+
return "cjs require";
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
CommonJsRequireDependency.Template = ModuleDependencyTemplateAsId;
|
21
|
+
|
22
|
+
module.exports = CommonJsRequireDependency;
|
@@ -1,20 +1,20 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
const WebpackError = require("../WebpackError");
|
8
|
-
|
9
|
-
class CriticalDependencyWarning extends WebpackError {
|
10
|
-
constructor(message) {
|
11
|
-
super();
|
12
|
-
|
13
|
-
this.name = "CriticalDependencyWarning";
|
14
|
-
this.message = "Critical dependency: " + message;
|
15
|
-
|
16
|
-
Error.captureStackTrace(this, this.constructor);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
module.exports = CriticalDependencyWarning;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
const WebpackError = require("../WebpackError");
|
8
|
+
|
9
|
+
class CriticalDependencyWarning extends WebpackError {
|
10
|
+
constructor(message) {
|
11
|
+
super();
|
12
|
+
|
13
|
+
this.name = "CriticalDependencyWarning";
|
14
|
+
this.message = "Critical dependency: " + message;
|
15
|
+
|
16
|
+
Error.captureStackTrace(this, this.constructor);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
module.exports = CriticalDependencyWarning;
|
@@ -1,18 +1,18 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
|
8
|
-
class DelegatedSourceDependency extends ModuleDependency {
|
9
|
-
constructor(request) {
|
10
|
-
super(request);
|
11
|
-
}
|
12
|
-
|
13
|
-
get type() {
|
14
|
-
return "delegated source";
|
15
|
-
}
|
16
|
-
}
|
17
|
-
|
18
|
-
module.exports = DelegatedSourceDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
|
8
|
+
class DelegatedSourceDependency extends ModuleDependency {
|
9
|
+
constructor(request) {
|
10
|
+
super(request);
|
11
|
+
}
|
12
|
+
|
13
|
+
get type() {
|
14
|
+
return "delegated source";
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
module.exports = DelegatedSourceDependency;
|
@@ -1,20 +1,20 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const Dependency = require("../Dependency");
|
7
|
-
|
8
|
-
class DllEntryDependency extends Dependency {
|
9
|
-
constructor(dependencies, name) {
|
10
|
-
super();
|
11
|
-
this.dependencies = dependencies;
|
12
|
-
this.name = name;
|
13
|
-
}
|
14
|
-
|
15
|
-
get type() {
|
16
|
-
return "dll entry";
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
module.exports = DllEntryDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const Dependency = require("../Dependency");
|
7
|
+
|
8
|
+
class DllEntryDependency extends Dependency {
|
9
|
+
constructor(dependencies, name) {
|
10
|
+
super();
|
11
|
+
this.dependencies = dependencies;
|
12
|
+
this.name = name;
|
13
|
+
}
|
14
|
+
|
15
|
+
get type() {
|
16
|
+
return "dll entry";
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
module.exports = DllEntryDependency;
|
@@ -1,23 +1,23 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
class LocalModule {
|
8
|
-
constructor(module, name, idx) {
|
9
|
-
this.module = module;
|
10
|
-
this.name = name;
|
11
|
-
this.idx = idx;
|
12
|
-
this.used = false;
|
13
|
-
}
|
14
|
-
|
15
|
-
flagUsed() {
|
16
|
-
this.used = true;
|
17
|
-
}
|
18
|
-
|
19
|
-
variableName() {
|
20
|
-
return "__WEBPACK_LOCAL_MODULE_" + this.idx + "__";
|
21
|
-
}
|
22
|
-
}
|
23
|
-
module.exports = LocalModule;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
class LocalModule {
|
8
|
+
constructor(module, name, idx) {
|
9
|
+
this.module = module;
|
10
|
+
this.name = name;
|
11
|
+
this.idx = idx;
|
12
|
+
this.used = false;
|
13
|
+
}
|
14
|
+
|
15
|
+
flagUsed() {
|
16
|
+
this.used = true;
|
17
|
+
}
|
18
|
+
|
19
|
+
variableName() {
|
20
|
+
return "__WEBPACK_LOCAL_MODULE_" + this.idx + "__";
|
21
|
+
}
|
22
|
+
}
|
23
|
+
module.exports = LocalModule;
|
@@ -1,23 +1,23 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
|
8
|
-
|
9
|
-
class ModuleHotAcceptDependency extends ModuleDependency {
|
10
|
-
constructor(request, range) {
|
11
|
-
super(request);
|
12
|
-
this.range = range;
|
13
|
-
this.weak = true;
|
14
|
-
}
|
15
|
-
|
16
|
-
get type() {
|
17
|
-
return "module.hot.accept";
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
ModuleHotAcceptDependency.Template = ModuleDependencyTemplateAsId;
|
22
|
-
|
23
|
-
module.exports = ModuleHotAcceptDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
|
8
|
+
|
9
|
+
class ModuleHotAcceptDependency extends ModuleDependency {
|
10
|
+
constructor(request, range) {
|
11
|
+
super(request);
|
12
|
+
this.range = range;
|
13
|
+
this.weak = true;
|
14
|
+
}
|
15
|
+
|
16
|
+
get type() {
|
17
|
+
return "module.hot.accept";
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
ModuleHotAcceptDependency.Template = ModuleDependencyTemplateAsId;
|
22
|
+
|
23
|
+
module.exports = ModuleHotAcceptDependency;
|
@@ -1,23 +1,23 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
|
8
|
-
|
9
|
-
class ModuleHotDeclineDependency extends ModuleDependency {
|
10
|
-
constructor(request, range) {
|
11
|
-
super(request);
|
12
|
-
this.range = range;
|
13
|
-
this.weak = true;
|
14
|
-
}
|
15
|
-
|
16
|
-
get type() {
|
17
|
-
return "module.hot.decline";
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
ModuleHotDeclineDependency.Template = ModuleDependencyTemplateAsId;
|
22
|
-
|
23
|
-
module.exports = ModuleHotDeclineDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
|
8
|
+
|
9
|
+
class ModuleHotDeclineDependency extends ModuleDependency {
|
10
|
+
constructor(request, range) {
|
11
|
+
super(request);
|
12
|
+
this.range = range;
|
13
|
+
this.weak = true;
|
14
|
+
}
|
15
|
+
|
16
|
+
get type() {
|
17
|
+
return "module.hot.decline";
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
ModuleHotDeclineDependency.Template = ModuleDependencyTemplateAsId;
|
22
|
+
|
23
|
+
module.exports = ModuleHotDeclineDependency;
|
@@ -1,18 +1,18 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
|
8
|
-
class PrefetchDependency extends ModuleDependency {
|
9
|
-
constructor(request) {
|
10
|
-
super(request);
|
11
|
-
}
|
12
|
-
|
13
|
-
get type() {
|
14
|
-
return "prefetch";
|
15
|
-
}
|
16
|
-
}
|
17
|
-
|
18
|
-
module.exports = PrefetchDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
|
8
|
+
class PrefetchDependency extends ModuleDependency {
|
9
|
+
constructor(request) {
|
10
|
+
super(request);
|
11
|
+
}
|
12
|
+
|
13
|
+
get type() {
|
14
|
+
return "prefetch";
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
module.exports = PrefetchDependency;
|
@@ -1,21 +1,21 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
const NullDependency = require("./NullDependency");
|
8
|
-
|
9
|
-
class RequireEnsureItemDependency extends ModuleDependency {
|
10
|
-
constructor(request) {
|
11
|
-
super(request);
|
12
|
-
}
|
13
|
-
|
14
|
-
get type() {
|
15
|
-
return "require.ensure item";
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
RequireEnsureItemDependency.Template = NullDependency.Template;
|
20
|
-
|
21
|
-
module.exports = RequireEnsureItemDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
const NullDependency = require("./NullDependency");
|
8
|
+
|
9
|
+
class RequireEnsureItemDependency extends ModuleDependency {
|
10
|
+
constructor(request) {
|
11
|
+
super(request);
|
12
|
+
}
|
13
|
+
|
14
|
+
get type() {
|
15
|
+
return "require.ensure item";
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
RequireEnsureItemDependency.Template = NullDependency.Template;
|
20
|
+
|
21
|
+
module.exports = RequireEnsureItemDependency;
|
@@ -1,22 +1,22 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
const ModuleDependencyAsId = require("./ModuleDependencyTemplateAsId");
|
8
|
-
|
9
|
-
class RequireResolveDependency extends ModuleDependency {
|
10
|
-
constructor(request, range) {
|
11
|
-
super(request);
|
12
|
-
this.range = range;
|
13
|
-
}
|
14
|
-
|
15
|
-
get type() {
|
16
|
-
return "require.resolve";
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
RequireResolveDependency.Template = ModuleDependencyAsId;
|
21
|
-
|
22
|
-
module.exports = RequireResolveDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
const ModuleDependencyAsId = require("./ModuleDependencyTemplateAsId");
|
8
|
+
|
9
|
+
class RequireResolveDependency extends ModuleDependency {
|
10
|
+
constructor(request, range) {
|
11
|
+
super(request);
|
12
|
+
this.range = range;
|
13
|
+
}
|
14
|
+
|
15
|
+
get type() {
|
16
|
+
return "require.resolve";
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
RequireResolveDependency.Template = ModuleDependencyAsId;
|
21
|
+
|
22
|
+
module.exports = RequireResolveDependency;
|
@@ -1,22 +1,22 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
const fs = require("fs");
|
8
|
-
const path = require("path");
|
9
|
-
const mkdirp = require("mkdirp");
|
10
|
-
|
11
|
-
class NodeOutputFileSystem {
|
12
|
-
constructor() {
|
13
|
-
this.mkdirp = mkdirp;
|
14
|
-
this.mkdir = fs.mkdir.bind(fs);
|
15
|
-
this.rmdir = fs.rmdir.bind(fs);
|
16
|
-
this.unlink = fs.unlink.bind(fs);
|
17
|
-
this.writeFile = fs.writeFile.bind(fs);
|
18
|
-
this.join = path.join.bind(path);
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
|
-
module.exports = NodeOutputFileSystem;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
const fs = require("fs");
|
8
|
+
const path = require("path");
|
9
|
+
const mkdirp = require("mkdirp");
|
10
|
+
|
11
|
+
class NodeOutputFileSystem {
|
12
|
+
constructor() {
|
13
|
+
this.mkdirp = mkdirp;
|
14
|
+
this.mkdir = fs.mkdir.bind(fs);
|
15
|
+
this.rmdir = fs.rmdir.bind(fs);
|
16
|
+
this.unlink = fs.unlink.bind(fs);
|
17
|
+
this.writeFile = fs.writeFile.bind(fs);
|
18
|
+
this.join = path.join.bind(path);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
module.exports = NodeOutputFileSystem;
|
@@ -91,7 +91,7 @@ class OccurrenceOrderPlugin {
|
|
91
91
|
if (aOccurs < bOccurs) return 1;
|
92
92
|
const orgA = originalOrder.get(a);
|
93
93
|
const orgB = originalOrder.get(b);
|
94
|
-
return
|
94
|
+
return orgA - orgB;
|
95
95
|
});
|
96
96
|
}
|
97
97
|
);
|
@@ -124,7 +124,7 @@ class OccurrenceOrderPlugin {
|
|
124
124
|
if (aOccurs < bOccurs) return 1;
|
125
125
|
const orgA = originalOrder.get(a);
|
126
126
|
const orgB = originalOrder.get(b);
|
127
|
-
return
|
127
|
+
return orgA - orgB;
|
128
128
|
});
|
129
129
|
}
|
130
130
|
);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "4.16.
|
3
|
+
"version": "4.16.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
|
"license": "MIT",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"ajv-keywords": "^3.1.0",
|
17
17
|
"chrome-trace-event": "^1.0.0",
|
18
18
|
"enhanced-resolve": "^4.1.0",
|
19
|
-
"eslint-scope": "^
|
19
|
+
"eslint-scope": "^4.0.0",
|
20
20
|
"json-parse-better-errors": "^1.0.2",
|
21
21
|
"loader-runner": "^2.3.0",
|
22
22
|
"loader-utils": "^1.1.0",
|
@@ -43,11 +43,11 @@
|
|
43
43
|
"coveralls": "^2.11.2",
|
44
44
|
"css-loader": "^0.28.3",
|
45
45
|
"es6-promise-polyfill": "^1.1.1",
|
46
|
-
"eslint": "^
|
46
|
+
"eslint": "^5.1.0",
|
47
47
|
"eslint-config-prettier": "^2.9.0",
|
48
48
|
"eslint-plugin-jest": "^21.17.0",
|
49
49
|
"eslint-plugin-node": "^6.0.1",
|
50
|
-
"eslint-plugin-prettier": "^2.6.
|
50
|
+
"eslint-plugin-prettier": "^2.6.2",
|
51
51
|
"express": "~4.13.1",
|
52
52
|
"file-loader": "^1.1.6",
|
53
53
|
"glob": "^7.1.2",
|
@@ -61,9 +61,9 @@
|
|
61
61
|
"json-loader": "^0.5.7",
|
62
62
|
"less": "^2.5.1",
|
63
63
|
"less-loader": "^4.0.3",
|
64
|
-
"lint-staged": "^7.
|
64
|
+
"lint-staged": "^7.2.0",
|
65
65
|
"lodash": "^4.17.4",
|
66
|
-
"prettier": "^1.13.
|
66
|
+
"prettier": "^1.13.7",
|
67
67
|
"pug": "^2.0.3",
|
68
68
|
"pug-loader": "^2.4.0",
|
69
69
|
"raw-loader": "~0.5.0",
|
@@ -73,7 +73,7 @@
|
|
73
73
|
"script-loader": "~0.7.0",
|
74
74
|
"simple-git": "^1.65.0",
|
75
75
|
"style-loader": "^0.19.1",
|
76
|
-
"typescript": "^
|
76
|
+
"typescript": "^3.0.0-rc",
|
77
77
|
"url-loader": "^0.6.2",
|
78
78
|
"val-loader": "^1.0.2",
|
79
79
|
"vm-browserify": "~0.0.0",
|
@@ -410,11 +410,7 @@
|
|
410
410
|
},
|
411
411
|
"hashDigest": {
|
412
412
|
"description": "Digest type used for the hash",
|
413
|
-
"
|
414
|
-
"latin1",
|
415
|
-
"hex",
|
416
|
-
"base64"
|
417
|
-
]
|
413
|
+
"type": "string"
|
418
414
|
},
|
419
415
|
"hashDigestLength": {
|
420
416
|
"description": "Number of chars which are used for the hash",
|
@@ -1596,7 +1592,7 @@
|
|
1596
1592
|
"type": "boolean"
|
1597
1593
|
},
|
1598
1594
|
"moduleIds": {
|
1599
|
-
"description": "Define the algorithm to choose module ids (natural: numeric ids in order
|
1595
|
+
"description": "Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: short hashes as ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin)",
|
1600
1596
|
"enum": [
|
1601
1597
|
"natural",
|
1602
1598
|
"named",
|