Commit Graph

39 Commits

Author SHA1 Message Date
alexander.akait 81f2e865a6 chore: update eslint to v9 2024-06-11 15:32:02 +03:00
alexander.akait 7b4775cebe fix(types): fix some types 2024-03-21 15:16:51 +03:00
alexander.akait be1d35eb02 fix(types): more 2024-03-18 18:50:56 +03:00
Hai f9ea6a22d2 Remove duplicate assign to _otherExportsInfo.canMangleUse 2024-02-22 21:23:25 +08:00
alexander.akait cc734af66e refactor(types): more 2023-06-22 02:45:07 +03:00
alexander.akait 4809421990 refactor(types): more 2023-06-21 19:00:24 +03:00
alexander.akait 4f6dc32d38 chore: improve types 2023-04-21 19:22:33 +03:00
Ivan Kopeykin 216c3daa4e fix ExportsInfo 2022-04-06 20:15:10 +03:00
Ivan Kopeykin 48305033f4 fix ExportsInfo
- should mark every export canMangleProvide=false if there are unknown exports
- add __webpack_exports_info__.<name>.canMangle to api
- add test case
2022-02-10 16:20:53 +03:00
Tobias Koppers 7135727cba avoid unneccessary separators and arrays 2021-10-04 09:29:09 +02:00
shfshanyue 92f84dcac0 chore: merge multi hash.update 2021-09-26 08:51:53 +08:00
Tobias Koppers 55dacb4b36 increment index in sorting 2021-05-27 21:45:40 +02:00
Tobias Koppers bb6040b07f (re)store provided exports sorted 2021-05-26 21:35:46 +02:00
Tobias Koppers cc5890163a improve ExportsInfo sorting performance by keeping Map size to avoid reorganizing 2021-05-26 21:35:46 +02:00
Tobias Koppers 83c8180c7d prioritize static reexport over runtime reexport for target determination
this allows to optimize cases where empty modules are reexported e. g. caused by typescript type-only exports
2021-04-06 21:36:43 +02:00
Tobias Koppers 87a70e03b8 unset targets when a harmony star reexport is hidden by another one 2021-02-22 21:56:00 +01:00
Tobias Koppers 1c0b88c72f fix bug where ExportInfo uses inactive connections to find the target of an export
This happens when multiple exports * export the same name but the first one is discovered later in the process
In this case the ExportInfo contains both connections, but the second one is inactive.
2021-02-22 12:47:34 +01:00
Tobias Koppers 35807ca018 add very basic library type "module" 2021-02-09 21:28:18 +01:00
Tobias Koppers 97b83161d9 move responsibility of exports info and connected modules hashing from Dependencies to Module
fixes a bug where modules are incorrectly cached when exports info of connected modules change
2021-01-24 21:36:36 +01:00
Matvii Hodovaniuk 62a1474db5
Remove code duplication
The body of this case clause 'UsageState.Unknown' duplicates the body of this case clause 'case UsageState.Used'. This may be caused by a copy-paste error. If this usage is intentional, consider using fall-through to remove code duplication.
2020-12-29 19:47:23 +02:00
Tobias Koppers 07fc323684 ignore cloned ExportInfo during hashing 2020-12-23 20:39:54 +01:00
Tobias Koppers cbcd459d19 fix conflicting real imports and type imports 2020-11-26 10:02:59 +01:00
Tobias Koppers f32762ed69 fix #11990 2020-11-16 11:53:19 +01:00
Tobias Koppers 6db9f1f617 build chunk graph with runtime awareness
this avoid including modules that are not used in specific runtimes
add new test suite to test usedExports: "global" too
2020-10-16 11:47:38 +02:00
Tobias Koppers 0fe03c7af0 fix unused modules in chunk when optimizing runtime-specific
fixes #11673
2020-10-16 11:47:33 +02:00
Tobias Koppers 2888c8a406
Revert "fix unused modules in chunk when optimizing runtime-specific " 2020-10-15 20:17:26 +02:00
Tobias Koppers 50c3a83340 fix unused modules in chunk when optimizing runtime-specific
fixes #11673
2020-10-15 10:18:41 +02:00
Tobias Koppers db8c974733 return false when no valid target can be found 2020-09-15 12:36:31 +02:00
Tobias Koppers 9af1d7526b refactor module concatenation to address discovered bugs/edge cases 2020-09-15 12:36:02 +02:00
Tobias Koppers 71cf7f4dc8 add support for reexporting in CommonJS
and necessary refactoring + fixes for that
2020-08-17 21:32:47 +02:00
Tobias Koppers 3cf8299602 add test case for conflicting named with namespace reexport
and fix problem
2020-08-13 10:59:56 +02:00
Tobias Koppers 801f01cb87 performance optimization 2020-08-13 10:22:37 +02:00
Tobias Koppers 8b91b6c508 use target info to implement side effects plugin 2020-08-12 23:20:45 +02:00
Tobias Koppers 67077b7183 replace recursion with loop 2020-08-12 22:37:33 +02:00
Tobias Koppers 9b80cde76c store multiple targets per ExportInfo
resolve target when reading
2020-08-12 21:41:03 +02:00
Tobias Koppers 163e7674a0 track the target binding of harmony reexports
display target binding in module info header
check conflicting star exports (fixes #7562) when statically known
2020-08-11 20:13:01 +02:00
Tobias Koppers a4f17775b1 fix dependOn behavior with runtimes, fix runtime passing by entry 2020-07-30 11:18:09 +02:00
Tobias Koppers 1265765141 polish, types 2020-07-27 22:41:04 +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