Commit Graph

138 Commits

Author SHA1 Message Date
ahabhgk fc7b34d8f0 fix: should not mangle when destructuring a reexport 2024-02-18 17:10:32 +08:00
ahabhgk 69127aed6e add test 2024-02-06 17:49:47 +08:00
ahabhgk 213290ea65 fix: not mangle export with destructuring 2024-02-06 17:47:11 +08:00
Ben Worline b14922c5be Refactor shared code 2023-10-02 10:28:43 -07:00
alexander.akait d9d64b5198 refactor(types): more 2023-06-21 19:01:53 +03:00
alexander.akait e226101c55 refactor(types): more 2023-06-21 19:00:24 +03:00
alexander.akait e381884115 refactor(types): more 2023-06-21 19:00:24 +03:00
Ben Worline c8dc5fac9b Handle barrel imports (#17305) 2023-06-02 15:16:53 -07:00
Ben Worline 5ab7e50503 handle null dep.idRangeStarts 2023-05-31 08:14:40 -07:00
Ben Worline 9bb13a8be6 incorporate CR feedback 2023-05-30 23:06:15 -07:00
Ben Worline b834303d83 add more error handling and json import support 2023-05-26 12:04:57 -07:00
Ben Worline af6626981e fix use of "at" 2023-05-24 06:12:10 -07:00
Ben Worline 5b88a4865e yarn type-lint 2023-05-23 22:24:20 -07:00
Ben Worline a8bb2d73f8 Merge branch 'main' of https://github.com/webpack/webpack into ns 2023-05-23 20:22:06 -07:00
Ben Worline 7bdd6436ba move comment 2023-05-23 20:03:49 -07:00
Ben Worline 6f43ce3bfb checkpoint 2023-05-23 15:29:25 -07:00
alexander.akait 055737dc0c refactor(types): more 2023-05-21 23:31:30 +03:00
alexander.akait 4f6dc32d38 chore: improve types 2023-04-21 19:22:33 +03:00
Ivan Kopeykin 8c8a3a0a99 fix caching 2023-04-09 11:33:49 +03:00
Ivan Kopeykin 45754f45d0 rename some properties, add more test cases 2023-04-09 10:44:09 +03:00
Ivan Kopeykin 397ce0c84e add import tree shaking support 2023-04-09 00:23:15 +03:00
Tobias Koppers b095e8d138 remove arguments, replace whole expression 2022-03-08 08:02:54 +01:00
Ivan Kopeykin f9779f1d0c improve dependency 2022-03-04 11:39:51 +03:00
Mark Molinaro 0f22db981d Fix names of options to match the exported types 2021-11-06 00:01:21 +00:00
Tobias Koppers 4b5d1360d8 fix serialization and snapshots 2021-11-03 11:34:26 +01:00
Tobias Koppers d9c592738a refactor and add test cases
add `parser.exportPresence`, `parser.importExportPresence`, `parser.reeexportExportPresence` `"error" | "warn" | "auto" | false`
2021-11-02 18:29:47 +01:00
Sven Sauleau 6c50c81350 Revert "Revert "Merge pull request #12278 from xtuc/sven/import-assertions""
This reverts commit 61946b7c46.
2021-07-24 23:28:30 +01:00
Tobias Koppers 61946b7c46 Revert "Merge pull request #12278 from xtuc/sven/import-assertions"
This reverts commit df02bc6c0a, reversing
changes made to a6f341e243.
2021-07-16 21:54:21 +02:00
Tobias Koppers 7f22e4721f match on asserts
change Map to Record
improve test case
2021-07-16 13:17:20 +02:00
Tobias Koppers b0fa9ccada pretty files 2021-05-11 09:31:46 +02: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 a936d7b3a0 avoid unnecessary conditions 2021-01-27 13:37:34 +01:00
Tobias Koppers 21c08d56ec avoid allocation of meta info for dependencies when unused 2021-01-27 13:37:34 +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
Tobias Koppers 4ec418c8ee allow inner graph shaking for new URL()
fixes #11818
2021-01-19 13:31:55 +01:00
Tobias Koppers 7cc206974c upgrade typescript major version 2020-11-30 08:42:35 +01:00
Tobias Koppers c7ea63875c improve side effects analysis to report imported and reexports symbols as side-effect-free
add bailout messages for side effects
2020-11-28 18:10:27 +01:00
Tobias Koppers e1a405e3c2 prettier 2020-11-26 10:52:55 +01:00
Tobias Koppers 19f51535ca merge multiple import statements with different conditions correctly
improve hashing when conditional runtime evaluation is involved
add test cases
2020-10-27 06:48:54 +01:00
Tobias Koppers 8e562aa260 fix some nitpicks with active state 2020-10-07 09:36:41 +02:00
Tobias Koppers fcca1d649d analyse source code for side effects
mark the module as side effects free in such cases
allow 3rd state TRANSITIVE_ONLY to be side-effect-free but dependencies should still be included (for mini-css-extract-plugin)
2020-10-06 14:10:29 +02:00
Tobias Koppers 8db617db80 avoid error when target module failed 2020-09-25 10:53:12 +02:00
Tobias Koppers 39e1a7e4c7 move magic names to constants in ConcatenationScope
improve types
2020-09-15 12:36:06 +02:00
Tobias Koppers 21e202eb24 move concatenation logic to HarmonyImportSpecifierDependency 2020-09-15 12:35:30 +02:00
Ivan Kopeykin a3fc25cadb refactor asiSafe flag in dependencies 2020-08-29 17:00:03 +03: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 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
Pushkar DK 31e3369a73 Add 'webpackExports' & make only referenced exports available in import() 2020-06-06 00:11:21 +05:30
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 782e4535ac Refactor how exportsType work
add flagged exportsType for __esModule flagged
add getExportsType to merge strict with exportsType
move CommonJsStuffPlugin into CommonJsPlugin
split CommonJsPlugin into imports and exports part
enable minimal tree shaking for CommonJs imports and exports
2019-12-06 11:13:08 +01:00