webpack 4.20.1 → 4.20.2

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 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/SECURITY.md CHANGED
@@ -1,9 +1,9 @@
1
- # Reporting Security Issues
2
-
3
- If you discover a security issue in webpack, please report it by sending an
4
- email to [webpack@opencollective.com](mailto:webpack@opencollective.com).
5
-
6
- This will allow us to assess the risk, and make a fix available before we add a
7
- bug report to the GitHub repository.
8
-
9
- Thanks for helping make webpack safe for everyone.
1
+ # Reporting Security Issues
2
+
3
+ If you discover a security issue in webpack, please report it by sending an
4
+ email to [webpack@opencollective.com](mailto:webpack@opencollective.com).
5
+
6
+ This will allow us to assess the risk, and make a fix available before we add a
7
+ bug report to the GitHub repository.
8
+
9
+ Thanks for helping make webpack safe for everyone.
@@ -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
+ };
@@ -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/global.js CHANGED
@@ -1,20 +1,20 @@
1
- var g;
2
-
3
- // This works in non-strict mode
4
- g = (function() {
5
- return this;
6
- })();
7
-
8
- try {
9
- // This works if eval is allowed (see CSP)
10
- g = g || Function("return this")() || (1, eval)("this");
11
- } catch (e) {
12
- // This works if the window reference is available
13
- if (typeof window === "object") g = window;
14
- }
15
-
16
- // g can still be undefined, but nothing to do about it...
17
- // We return undefined, instead of nothing here, so it's
18
- // easier to handle this case. if(!global) { ...}
19
-
20
- module.exports = g;
1
+ var g;
2
+
3
+ // This works in non-strict mode
4
+ g = (function() {
5
+ return this;
6
+ })();
7
+
8
+ try {
9
+ // This works if eval is allowed (see CSP)
10
+ g = g || Function("return this")() || (1, eval)("this");
11
+ } catch (e) {
12
+ // This works if the window reference is available
13
+ if (typeof window === "object") g = window;
14
+ }
15
+
16
+ // g can still be undefined, but nothing to do about it...
17
+ // We return undefined, instead of nothing here, so it's
18
+ // easier to handle this case. if(!global) { ...}
19
+
20
+ module.exports = g;
package/buildin/module.js CHANGED
@@ -1,22 +1,22 @@
1
- module.exports = function(module) {
2
- if (!module.webpackPolyfill) {
3
- module.deprecate = function() {};
4
- module.paths = [];
5
- // module.parent = undefined by default
6
- if (!module.children) module.children = [];
7
- Object.defineProperty(module, "loaded", {
8
- enumerable: true,
9
- get: function() {
10
- return module.l;
11
- }
12
- });
13
- Object.defineProperty(module, "id", {
14
- enumerable: true,
15
- get: function() {
16
- return module.i;
17
- }
18
- });
19
- module.webpackPolyfill = 1;
20
- }
21
- return module;
22
- };
1
+ module.exports = function(module) {
2
+ if (!module.webpackPolyfill) {
3
+ module.deprecate = function() {};
4
+ module.paths = [];
5
+ // module.parent = undefined by default
6
+ if (!module.children) module.children = [];
7
+ Object.defineProperty(module, "loaded", {
8
+ enumerable: true,
9
+ get: function() {
10
+ return module.l;
11
+ }
12
+ });
13
+ Object.defineProperty(module, "id", {
14
+ enumerable: true,
15
+ get: function() {
16
+ return module.i;
17
+ }
18
+ });
19
+ module.webpackPolyfill = 1;
20
+ }
21
+ return module;
22
+ };
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();
@@ -1,211 +1,211 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra
4
- */
5
-
6
- "use strict";
7
-
8
- const TypeUnknown = 0;
9
- const TypeNull = 1;
10
- const TypeString = 2;
11
- const TypeNumber = 3;
12
- const TypeBoolean = 4;
13
- const TypeRegExp = 5;
14
- const TypeConditional = 6;
15
- const TypeArray = 7;
16
- const TypeConstArray = 8;
17
- const TypeIdentifier = 9;
18
- const TypeWrapped = 10;
19
- const TypeTemplateString = 11;
20
-
21
- class BasicEvaluatedExpression {
22
- constructor() {
23
- this.type = TypeUnknown;
24
- this.range = null;
25
- this.falsy = false;
26
- this.truthy = false;
27
- this.bool = null;
28
- this.number = null;
29
- this.regExp = null;
30
- this.string = null;
31
- this.quasis = null;
32
- this.array = null;
33
- this.items = null;
34
- this.options = null;
35
- this.prefix = null;
36
- this.postfix = null;
37
- }
38
-
39
- isNull() {
40
- return this.type === TypeNull;
41
- }
42
-
43
- isString() {
44
- return this.type === TypeString;
45
- }
46
-
47
- isNumber() {
48
- return this.type === TypeNumber;
49
- }
50
-
51
- isBoolean() {
52
- return this.type === TypeBoolean;
53
- }
54
-
55
- isRegExp() {
56
- return this.type === TypeRegExp;
57
- }
58
-
59
- isConditional() {
60
- return this.type === TypeConditional;
61
- }
62
-
63
- isArray() {
64
- return this.type === TypeArray;
65
- }
66
-
67
- isConstArray() {
68
- return this.type === TypeConstArray;
69
- }
70
-
71
- isIdentifier() {
72
- return this.type === TypeIdentifier;
73
- }
74
-
75
- isWrapped() {
76
- return this.type === TypeWrapped;
77
- }
78
-
79
- isTemplateString() {
80
- return this.type === TypeTemplateString;
81
- }
82
-
83
- isTruthy() {
84
- return this.truthy;
85
- }
86
-
87
- isFalsy() {
88
- return this.falsy;
89
- }
90
-
91
- asBool() {
92
- if (this.truthy) return true;
93
- if (this.falsy) return false;
94
- if (this.isBoolean()) return this.bool;
95
- if (this.isNull()) return false;
96
- if (this.isString()) return this.string !== "";
97
- if (this.isNumber()) return this.number !== 0;
98
- if (this.isRegExp()) return true;
99
- if (this.isArray()) return true;
100
- if (this.isConstArray()) return true;
101
- if (this.isWrapped()) {
102
- return (this.prefix && this.prefix.asBool()) ||
103
- (this.postfix && this.postfix.asBool())
104
- ? true
105
- : undefined;
106
- }
107
- if (this.isTemplateString()) {
108
- for (const quasi of this.quasis) {
109
- if (quasi.asBool()) return true;
110
- }
111
- // can't tell if string will be empty without executing
112
- }
113
- return undefined;
114
- }
115
-
116
- setString(string) {
117
- this.type = TypeString;
118
- this.string = string;
119
- return this;
120
- }
121
-
122
- setNull() {
123
- this.type = TypeNull;
124
- return this;
125
- }
126
-
127
- setNumber(number) {
128
- this.type = TypeNumber;
129
- this.number = number;
130
- return this;
131
- }
132
-
133
- setBoolean(bool) {
134
- this.type = TypeBoolean;
135
- this.bool = bool;
136
- return this;
137
- }
138
-
139
- setRegExp(regExp) {
140
- this.type = TypeRegExp;
141
- this.regExp = regExp;
142
- return this;
143
- }
144
-
145
- setIdentifier(identifier) {
146
- this.type = TypeIdentifier;
147
- this.identifier = identifier;
148
- return this;
149
- }
150
-
151
- setWrapped(prefix, postfix) {
152
- this.type = TypeWrapped;
153
- this.prefix = prefix;
154
- this.postfix = postfix;
155
- return this;
156
- }
157
-
158
- setOptions(options) {
159
- this.type = TypeConditional;
160
- this.options = options;
161
- return this;
162
- }
163
-
164
- addOptions(options) {
165
- if (!this.options) {
166
- this.type = TypeConditional;
167
- this.options = [];
168
- }
169
- for (const item of options) {
170
- this.options.push(item);
171
- }
172
- return this;
173
- }
174
-
175
- setItems(items) {
176
- this.type = TypeArray;
177
- this.items = items;
178
- return this;
179
- }
180
-
181
- setArray(array) {
182
- this.type = TypeConstArray;
183
- this.array = array;
184
- return this;
185
- }
186
-
187
- setTemplateString(quasis) {
188
- this.type = TypeTemplateString;
189
- this.quasis = quasis;
190
- return this;
191
- }
192
-
193
- setTruthy() {
194
- this.falsy = false;
195
- this.truthy = true;
196
- return this;
197
- }
198
-
199
- setFalsy() {
200
- this.falsy = true;
201
- this.truthy = false;
202
- return this;
203
- }
204
-
205
- setRange(range) {
206
- this.range = range;
207
- return this;
208
- }
209
- }
210
-
211
- module.exports = BasicEvaluatedExpression;
1
+ /*
2
+ MIT License http://www.opensource.org/licenses/mit-license.php
3
+ Author Tobias Koppers @sokra
4
+ */
5
+
6
+ "use strict";
7
+
8
+ const TypeUnknown = 0;
9
+ const TypeNull = 1;
10
+ const TypeString = 2;
11
+ const TypeNumber = 3;
12
+ const TypeBoolean = 4;
13
+ const TypeRegExp = 5;
14
+ const TypeConditional = 6;
15
+ const TypeArray = 7;
16
+ const TypeConstArray = 8;
17
+ const TypeIdentifier = 9;
18
+ const TypeWrapped = 10;
19
+ const TypeTemplateString = 11;
20
+
21
+ class BasicEvaluatedExpression {
22
+ constructor() {
23
+ this.type = TypeUnknown;
24
+ this.range = null;
25
+ this.falsy = false;
26
+ this.truthy = false;
27
+ this.bool = null;
28
+ this.number = null;
29
+ this.regExp = null;
30
+ this.string = null;
31
+ this.quasis = null;
32
+ this.array = null;
33
+ this.items = null;
34
+ this.options = null;
35
+ this.prefix = null;
36
+ this.postfix = null;
37
+ }
38
+
39
+ isNull() {
40
+ return this.type === TypeNull;
41
+ }
42
+
43
+ isString() {
44
+ return this.type === TypeString;
45
+ }
46
+
47
+ isNumber() {
48
+ return this.type === TypeNumber;
49
+ }
50
+
51
+ isBoolean() {
52
+ return this.type === TypeBoolean;
53
+ }
54
+
55
+ isRegExp() {
56
+ return this.type === TypeRegExp;
57
+ }
58
+
59
+ isConditional() {
60
+ return this.type === TypeConditional;
61
+ }
62
+
63
+ isArray() {
64
+ return this.type === TypeArray;
65
+ }
66
+
67
+ isConstArray() {
68
+ return this.type === TypeConstArray;
69
+ }
70
+
71
+ isIdentifier() {
72
+ return this.type === TypeIdentifier;
73
+ }
74
+
75
+ isWrapped() {
76
+ return this.type === TypeWrapped;
77
+ }
78
+
79
+ isTemplateString() {
80
+ return this.type === TypeTemplateString;
81
+ }
82
+
83
+ isTruthy() {
84
+ return this.truthy;
85
+ }
86
+
87
+ isFalsy() {
88
+ return this.falsy;
89
+ }
90
+
91
+ asBool() {
92
+ if (this.truthy) return true;
93
+ if (this.falsy) return false;
94
+ if (this.isBoolean()) return this.bool;
95
+ if (this.isNull()) return false;
96
+ if (this.isString()) return this.string !== "";
97
+ if (this.isNumber()) return this.number !== 0;
98
+ if (this.isRegExp()) return true;
99
+ if (this.isArray()) return true;
100
+ if (this.isConstArray()) return true;
101
+ if (this.isWrapped()) {
102
+ return (this.prefix && this.prefix.asBool()) ||
103
+ (this.postfix && this.postfix.asBool())
104
+ ? true
105
+ : undefined;
106
+ }
107
+ if (this.isTemplateString()) {
108
+ for (const quasi of this.quasis) {
109
+ if (quasi.asBool()) return true;
110
+ }
111
+ // can't tell if string will be empty without executing
112
+ }
113
+ return undefined;
114
+ }
115
+
116
+ setString(string) {
117
+ this.type = TypeString;
118
+ this.string = string;
119
+ return this;
120
+ }
121
+
122
+ setNull() {
123
+ this.type = TypeNull;
124
+ return this;
125
+ }
126
+
127
+ setNumber(number) {
128
+ this.type = TypeNumber;
129
+ this.number = number;
130
+ return this;
131
+ }
132
+
133
+ setBoolean(bool) {
134
+ this.type = TypeBoolean;
135
+ this.bool = bool;
136
+ return this;
137
+ }
138
+
139
+ setRegExp(regExp) {
140
+ this.type = TypeRegExp;
141
+ this.regExp = regExp;
142
+ return this;
143
+ }
144
+
145
+ setIdentifier(identifier) {
146
+ this.type = TypeIdentifier;
147
+ this.identifier = identifier;
148
+ return this;
149
+ }
150
+
151
+ setWrapped(prefix, postfix) {
152
+ this.type = TypeWrapped;
153
+ this.prefix = prefix;
154
+ this.postfix = postfix;
155
+ return this;
156
+ }
157
+
158
+ setOptions(options) {
159
+ this.type = TypeConditional;
160
+ this.options = options;
161
+ return this;
162
+ }
163
+
164
+ addOptions(options) {
165
+ if (!this.options) {
166
+ this.type = TypeConditional;
167
+ this.options = [];
168
+ }
169
+ for (const item of options) {
170
+ this.options.push(item);
171
+ }
172
+ return this;
173
+ }
174
+
175
+ setItems(items) {
176
+ this.type = TypeArray;
177
+ this.items = items;
178
+ return this;
179
+ }
180
+
181
+ setArray(array) {
182
+ this.type = TypeConstArray;
183
+ this.array = array;
184
+ return this;
185
+ }
186
+
187
+ setTemplateString(quasis) {
188
+ this.type = TypeTemplateString;
189
+ this.quasis = quasis;
190
+ return this;
191
+ }
192
+
193
+ setTruthy() {
194
+ this.falsy = false;
195
+ this.truthy = true;
196
+ return this;
197
+ }
198
+
199
+ setFalsy() {
200
+ this.falsy = true;
201
+ this.truthy = false;
202
+ return this;
203
+ }
204
+
205
+ setRange(range) {
206
+ this.range = range;
207
+ return this;
208
+ }
209
+ }
210
+
211
+ module.exports = BasicEvaluatedExpression;
@@ -1364,12 +1364,20 @@ class HarmonyExportExpressionDependencyConcatenatedTemplate {
1364
1364
  }
1365
1365
 
1366
1366
  if (dep.range) {
1367
- source.replace(dep.rangeStatement[0], dep.range[0] - 1, content + "(");
1367
+ source.replace(
1368
+ dep.rangeStatement[0],
1369
+ dep.range[0] - 1,
1370
+ content + "(" + dep.prefix
1371
+ );
1368
1372
  source.replace(dep.range[1], dep.rangeStatement[1] - 1, ");");
1369
1373
  return;
1370
1374
  }
1371
1375
 
1372
- source.replace(dep.rangeStatement[0], dep.rangeStatement[1] - 1, content);
1376
+ source.replace(
1377
+ dep.rangeStatement[0],
1378
+ dep.rangeStatement[1] - 1,
1379
+ content + dep.prefix
1380
+ );
1373
1381
  }
1374
1382
  }
1375
1383
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "4.20.1",
3
+ "version": "4.20.2",
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",
@@ -1,55 +1,55 @@
1
- "use strict";
2
-
3
- const errorMessage = (schema, data, message) => ({
4
- keyword: "absolutePath",
5
- params: { absolutePath: data },
6
- message: message,
7
- parentSchema: schema
8
- });
9
-
10
- const getErrorFor = (shouldBeAbsolute, data, schema) => {
11
- const message = shouldBeAbsolute
12
- ? `The provided value ${JSON.stringify(data)} is not an absolute path!`
13
- : `A relative path is expected. However, the provided value ${JSON.stringify(
14
- data
15
- )} is an absolute path!`;
16
-
17
- return errorMessage(schema, data, message);
18
- };
19
-
20
- module.exports = ajv =>
21
- ajv.addKeyword("absolutePath", {
22
- errors: true,
23
- type: "string",
24
- compile(expected, schema) {
25
- function callback(data) {
26
- let passes = true;
27
- const isExclamationMarkPresent = data.includes("!");
28
- const isCorrectAbsoluteOrRelativePath =
29
- expected === /^(?:[A-Za-z]:\\|\/)/.test(data);
30
-
31
- if (isExclamationMarkPresent) {
32
- callback.errors = [
33
- errorMessage(
34
- schema,
35
- data,
36
- `The provided value ${JSON.stringify(
37
- data
38
- )} contans exclamation mark (!) which is not allowed because it's reserved for loader syntax.`
39
- )
40
- ];
41
- passes = false;
42
- }
43
-
44
- if (!isCorrectAbsoluteOrRelativePath) {
45
- callback.errors = [getErrorFor(expected, data, schema)];
46
- passes = false;
47
- }
48
-
49
- return passes;
50
- }
51
- callback.errors = [];
52
-
53
- return callback;
54
- }
55
- });
1
+ "use strict";
2
+
3
+ const errorMessage = (schema, data, message) => ({
4
+ keyword: "absolutePath",
5
+ params: { absolutePath: data },
6
+ message: message,
7
+ parentSchema: schema
8
+ });
9
+
10
+ const getErrorFor = (shouldBeAbsolute, data, schema) => {
11
+ const message = shouldBeAbsolute
12
+ ? `The provided value ${JSON.stringify(data)} is not an absolute path!`
13
+ : `A relative path is expected. However, the provided value ${JSON.stringify(
14
+ data
15
+ )} is an absolute path!`;
16
+
17
+ return errorMessage(schema, data, message);
18
+ };
19
+
20
+ module.exports = ajv =>
21
+ ajv.addKeyword("absolutePath", {
22
+ errors: true,
23
+ type: "string",
24
+ compile(expected, schema) {
25
+ function callback(data) {
26
+ let passes = true;
27
+ const isExclamationMarkPresent = data.includes("!");
28
+ const isCorrectAbsoluteOrRelativePath =
29
+ expected === /^(?:[A-Za-z]:\\|\/)/.test(data);
30
+
31
+ if (isExclamationMarkPresent) {
32
+ callback.errors = [
33
+ errorMessage(
34
+ schema,
35
+ data,
36
+ `The provided value ${JSON.stringify(
37
+ data
38
+ )} contans exclamation mark (!) which is not allowed because it's reserved for loader syntax.`
39
+ )
40
+ ];
41
+ passes = false;
42
+ }
43
+
44
+ if (!isCorrectAbsoluteOrRelativePath) {
45
+ callback.errors = [getErrorFor(expected, data, schema)];
46
+ passes = false;
47
+ }
48
+
49
+ return passes;
50
+ }
51
+ callback.errors = [];
52
+
53
+ return callback;
54
+ }
55
+ });