webpack 4.35.2 → 4.35.3
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/lib/JsonGenerator.js +7 -4
- package/lib/Parser.js +2 -3
- package/package.json +2 -3
package/lib/JsonGenerator.js
CHANGED
@@ -28,6 +28,7 @@ class JsonGenerator {
|
|
28
28
|
})
|
29
29
|
);
|
30
30
|
}
|
31
|
+
let finalJson;
|
31
32
|
if (
|
32
33
|
Array.isArray(module.buildMeta.providedExports) &&
|
33
34
|
!module.isUsed("default")
|
@@ -41,12 +42,14 @@ class JsonGenerator {
|
|
41
42
|
reducedJson[used] = data[exportName];
|
42
43
|
}
|
43
44
|
}
|
44
|
-
|
45
|
-
`${module.moduleArgument}.exports = ${stringifySafe(reducedJson)};`
|
46
|
-
);
|
45
|
+
finalJson = reducedJson;
|
47
46
|
} else {
|
48
|
-
|
47
|
+
finalJson = data;
|
49
48
|
}
|
49
|
+
// Use JSON because JSON.parse() is much faster than JavaScript evaluation
|
50
|
+
const jsonSource = JSON.stringify(stringifySafe(finalJson));
|
51
|
+
const jsonExpr = `JSON.parse(${jsonSource})`;
|
52
|
+
source.add(`${module.moduleArgument}.exports = ${jsonExpr};`);
|
50
53
|
return source;
|
51
54
|
}
|
52
55
|
}
|
package/lib/Parser.js
CHANGED
@@ -7,14 +7,13 @@
|
|
7
7
|
// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API
|
8
8
|
|
9
9
|
const acorn = require("acorn");
|
10
|
-
const acornDynamicImport = require("acorn-dynamic-import").default;
|
11
10
|
const { Tapable, SyncBailHook, HookMap } = require("tapable");
|
12
11
|
const util = require("util");
|
13
12
|
const vm = require("vm");
|
14
13
|
const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
15
14
|
const StackedSetMap = require("./util/StackedSetMap");
|
16
15
|
|
17
|
-
const acornParser = acorn.Parser
|
16
|
+
const acornParser = acorn.Parser;
|
18
17
|
|
19
18
|
const joinRanges = (startRange, endRange) => {
|
20
19
|
if (!endRange) return startRange;
|
@@ -25,7 +24,7 @@ const joinRanges = (startRange, endRange) => {
|
|
25
24
|
const defaultParserOptions = {
|
26
25
|
ranges: true,
|
27
26
|
locations: true,
|
28
|
-
ecmaVersion:
|
27
|
+
ecmaVersion: 11,
|
29
28
|
sourceType: "module",
|
30
29
|
onComment: null
|
31
30
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "4.35.
|
3
|
+
"version": "4.35.3",
|
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",
|
@@ -9,8 +9,7 @@
|
|
9
9
|
"@webassemblyjs/helper-module-context": "1.8.5",
|
10
10
|
"@webassemblyjs/wasm-edit": "1.8.5",
|
11
11
|
"@webassemblyjs/wasm-parser": "1.8.5",
|
12
|
-
"acorn": "^6.0
|
13
|
-
"acorn-dynamic-import": "^4.0.0",
|
12
|
+
"acorn": "^6.2.0",
|
14
13
|
"ajv": "^6.1.0",
|
15
14
|
"ajv-keywords": "^3.1.0",
|
16
15
|
"chrome-trace-event": "^1.0.0",
|