Commit Graph

11 Commits

Author SHA1 Message Date
david-fong 68aca0a86d handle escaping + update jest snapshot 2021-02-10 18:23:52 +01:00
David Fong 9a8e6c8c24 Use single-quoted string for JSON marshalling
See #12641
2021-02-10 18:23:04 +01:00
Tobias Koppers 92fba2d346 fix json related tree shaking and caching problems
json with constructor property now caches correctly
json generation with object prototype property now works correctly
tree shaking json array when accessing length property now works correctly
fix incorrect call context when calling properties on imports from CommonJS modules

fixes #12615
2021-02-07 16:43:44 +01:00
Tobias Koppers bd2106b512 implement module concatenation for json modules 2020-09-15 12:36:26 +02:00
Tobias Koppers e16bdfda6c refactor used exports analysis, hashing, code generation, optimizations
to keep track of runtimes, used exports depending on runtime

modules can have different hashes and generated code depending on runtime
chunks are only considered as equal for MergeDuplicateChunks and SplitChunks when exports used in contained modules are equal
added `optimization.usedExports: "global"` to opt-out from used exports analysis per runtime
added `splitChunks.usedExports` and `splitChunks.cacheGroups[x].usedExports` to enable/disable used exports comparing for modules
`splitChunks.usedExports` defaults to `true` in production
2020-07-27 22:40:44 +02:00
Tobias Koppers a643278726 refactor exports info logic always represent exports object instead of namespace object
improve test case
2020-04-22 21:01:29 +02:00
Tobias Koppers 567ff7f026 Don't use JSON.parse when json is a string 2019-12-20 12:53:17 +01:00
Sergey Melyukov bdc61abf82 refactor: merge generators in asset modules 2019-11-26 15:42:37 +01:00
Tobias Koppers 84b6817f60 consistency and bugfixes for reexporting json 2019-11-05 10:39:12 +01:00
Tobias Koppers 14ee25cd0a add support for tree-shaking JSON modules 2019-11-05 10:37:59 +01:00
evilebottnawi 8198ffb3e6 refactor: code 2019-10-22 00:14:05 +02:00