Commit Graph

108 Commits

Author SHA1 Message Date
alexander.akait ac2c8bec53 refactor: avoid using only runtime 2023-06-03 03:58:03 +03:00
alexander.akait e3b1837442 fix: compatibility `__non_webpack_require__` with ES modules 2023-06-03 02:13:44 +03:00
alexander.akait 792ee7e516 refactor(types): more 2023-05-31 14:56:55 +00:00
Burhanuddin Udaipurwala 8bf6d59f35 refactor: refactor usages of module.loaded 2023-05-26 21:12:29 +05:30
Burhanuddin Udaipurwala 839e2bf6ad refactor: use global runtime constants for webpack exports 2023-05-26 21:04:26 +05:30
alexander.akait 60e5e13eb8 refactor: more types 2023-05-25 01:41:32 +03:00
Burhanuddin Udaipurwala 8d8a0e0e56 refactor: use global constant instead of string literal 2023-05-19 21:25:47 +05:30
Sean Larkin e958ac552b refactor(types): Improve module type strictness and refactor module type string usages in module subclasses 2023-05-04 23:19:11 +00:00
Sean Larkin fa4cbf11a1 add more module type constants, use them across codebase 2023-03-31 10:56:32 -07:00
Ivan Kopeykin cd3ec1da92 refactor top level declarations usage 2022-02-11 17:59:35 +03:00
Ivan Kopeykin f1d329cc0e use nonNumericOnlyHash function for contentHash 2022-02-01 20:10:45 +03:00
Tobias Koppers 0bd1e789d4 generate "use strict" only when really needed 2021-07-22 16:09:09 +02:00
Tobias Koppers c469adc265 fix handling of onChunksLoaded with prefetching 2021-07-16 18:11:29 +02:00
shinyaigeek 1d8f9fd4d0 Fix: overwritten __webpack_exports__ on onChunksLoaded 2021-07-16 18:10:45 +02:00
Tobias Koppers 629f9f031c add support for module externals and automatic externals 2021-06-24 16:44:14 +02:00
Tobias Koppers c3af61fe2a add `__webpack_modules__` when `__webpack_require__` is used 2021-06-23 14:49:14 +02:00
Tobias Koppers b0fa9ccada pretty files 2021-05-11 09:31:46 +02:00
Tobias Koppers cb494c9a8b fix returning exports from runtime for libraries
fixes #13165
2021-04-22 09:32:17 +02:00
Tobias Koppers 24c5902374 add interceptModuleExecution, module cache and improve error messages 2021-04-14 14:37:00 +02:00
Tobias Koppers ea3e0a39ac add experiments.executeModule
rename runModule -> executeModule
improve error reporting
2021-04-12 12:27:55 +02:00
Tobias Koppers 065177df66 add experimental support for build time execution
allow to execute a part of the module graph at build time
e. g. to generate code or other assets

loaders have access to that via `this.importModule(request, options)`
2021-04-12 12:27:54 +02:00
Ali Al Amine 8dcaade8fc Fix #12908 2021-03-16 20:19:10 +02:00
Tobias Koppers d5992633e6 offer a hook to opt-out of strict mode 2021-03-15 16:38:50 +01:00
Tobias Koppers 404a854c8b improve hmr error handling abilities
pass module and moduleId with self error handler
add error handlers for dependency accept handlers
pass moduleId and dependencyId with dependency accept error handler
add output.strictModuleErrorHandling to opt-in into strict module error handling
HotModuleReplacementPlugin enalbed output.strictModuleErrorHandling automatically

fixes #12826
2021-03-09 20:23:00 +01:00
Tobias Koppers c7f93af138 refactor startup logic to better integrate with libraries
get rid of startupNoDefault and many custom logic regarding this in jsonp chunk loading
add onChunksLoaded runtime method to cover that for all chunk loading types
add `__webpack_runtime_id__` to access the current runtime
allow to use onChunksLoaded for other module types too
2021-03-08 20:25:09 +01:00
Tobias Koppers 5c42b918b4 further optimizations 2021-02-23 12:03:26 +01:00
Tobias Koppers 9f3950e571 add support for libraries combined with iife: false
fix missing runtime requirement for system.js context
fix inlining of modules when conflicting symbols are defined on top-level
2021-02-11 11:19:24 +01:00
Tobias Koppers 89e95d6bda newline fixes for startup code 2021-02-09 21:28:10 +01:00
Tobias Koppers b29dd3d224 add renderStartup hook 2021-02-09 21:27:10 +01:00
Tobias Koppers 1c8fe2a8f8 allow module inlining when exports is used 2021-02-09 21:26:23 +01:00
evilebottnawi 938fc8946a refactor: add semicolon 2021-01-27 15:47:04 +03:00
Tobias Koppers e9183f9810 only return result of startup when needed
fixes #12244
2021-01-18 19:21:12 +01:00
Tobias Koppers 48571c663f add selective runtime requirements from startup logic which doesn't prevent inlining modules
avoid using startup function for grab data from preexecuted chunks
2020-12-11 14:36:48 +01:00
Tobias Koppers 11a7cac537 add useSimpleSourceMap flag to enable/disable OriginalSource for generated code
pass reduced options object to Source.map() function
2020-10-26 16:33:38 +01:00
Tobias Koppers 2ec90b3687 add asset info for `sourceFilename` and `javascriptModule` 2020-10-22 10:47:23 +02:00
Tobias Koppers 8e562aa260 fix some nitpicks with active state 2020-10-07 09:36:41 +02:00
Tobias Koppers 6dad1d0d6b use better hash for renderManifest to avoid unnecessary invalidation
add bootstrap code to content hash
2020-09-28 11:42:05 +02:00
Tobias Koppers 041dfe15c7
Merge pull request #11440 from webpack/bugfix/hmr-incorrect-dispose
fix incorrect disposing of modules during HMR
2020-09-09 03:50:42 +02:00
Tobias Koppers 12997f0a6c fix incorrect disposing of modules during HMR 2020-09-08 10:25:41 +02:00
Tobias Koppers ed06a7f83a new Worker() support
add support for async anonymous entrypoints from inside the codebase
add worker example
move entry options into Entrypoint and receive them from there
2020-09-08 07:37:20 +02:00
Tobias Koppers 0f089187e4 improve hashing of runtime modules that need a full hash 2020-09-01 18:31:29 +02:00
Tobias Koppers 49d9ec5625 cleanup public api and expose JavascriptParser 2020-08-28 01:46:14 +02:00
Tobias Koppers 41a8e2ea48 use xor to hash modules instead of sorting them 2020-08-14 10:54:24 +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 50ec72a6ca use the full hash on modules that need the full hash of the compilation
use getFullHash runtime module for updating the hash in HMR
2020-04-30 17:57:01 +02:00
Tobias Koppers b9c50fdb09 fix jsdoc documentations 2020-04-28 19:42:58 +02:00
Tobias Koppers 6400fd42b4
Merge pull request #10139 from yurynix/relative-dir-runtime-chunk-loading
Make inner folder entrypoints able to require common chunks
2020-01-17 11:39:52 +01:00
Tobias Koppers 2350d09680 move chunk filename template logic into reusable function 2020-01-16 15:40:44 +01:00
Tobias Koppers b398814628 cache module wrappers in memory 2019-12-19 14:26:27 +01:00
Tobias Koppers ab8a768cac remove module.id and loaded shortcuts and only include them when used 2019-12-06 11:09:43 +01:00
Sergey Melyukov f212d3c30e pr comments 2019-12-03 18:11:46 +03:00
Sergey Melyukov faf784b6ab refactor hop runtime helper 2019-12-03 16:27:39 +03:00
Sergey Melyukov ba306b6f2c Merge remote-tracking branch 'upstream/master' into optimize-webpack-runtime-size 2019-12-02 19:54:21 +03:00
Sergey Melyukov 6b59d113a4 optimize webpack runtime size 2019-12-02 17:59:37 +03:00
Tobias Koppers fe67677f55 offer cached methods to get chunk modules by source type 2019-11-20 11:20:34 +01:00
Tobias Koppers efe0c2e610 avoid creating arrays in getConnections 2019-11-10 21:05:05 +01:00
Tobias Koppers 8d46b21fad add Dependency.getCondition and conditional ModuleGraphConnections
getDependencyReference is no longer used to check of connection
2019-10-30 07:48:32 +01:00
evilebottnawi 8198ffb3e6 refactor: code 2019-10-22 00:14:05 +02:00