Commit Graph

73 Commits

Author SHA1 Message Date
alexander.akait 4809421990 refactor(types): more 2023-06-21 19:00:24 +03:00
alexander.akait 0391116e8c refactor: use runtime logic but only when needed 2023-06-13 00:17:53 +03:00
alexander.akait 4649dc0025 fix: reduce runtime size 2023-06-12 21:55:53 +03:00
alexander.akait 620c8d5fa4 refactor: more types 2023-05-24 22:37:58 +03:00
Ivan Kopeykin ce56e3b61c add NonceRuntimeModule 2022-05-09 21:45:42 +03:00
Ivan Kopeykin bbbe300e3a use global chunkLoading option 2022-03-08 11:10:05 +03:00
Ivan Kopeykin 26f3a1d21c add base uri runtime module if chunkLoading=false 2022-03-07 12:28:03 +03:00
Tobias Koppers 1ed8aaf2e2
Merge pull request #14173 from tosmolka/tosmolka/14075
Support Trusted Types in EvalSourceMapDevToolPlugin
2022-01-20 17:36:55 +01:00
Tobias Koppers 0670cf5ba4 remove unneeded transitive runtime requirement 2022-01-20 16:35:25 +01:00
Tobias Koppers ccd42408eb fix css hmr support 2022-01-13 15:29:22 +01:00
Tobias Koppers 16784692d3 add `output.cssChunkFilename` 2021-12-17 12:18:01 +01:00
Tobias Koppers 77b5589c1a css generation and hmr 2021-12-03 08:46:22 +01:00
Tobias Smolka 59aa7b7c0b Fix linting errors 2021-09-08 13:09:01 +02:00
Tobias Smolka 1339272be6 Support Trusted Types in EvalSourceMapDevToolPlugin 2021-09-08 12:34:00 +02:00
Connor Pearson ee35a3ae5f respect entry-specific library.type when exposing system context
fix linting issues
2021-06-30 08:54:57 +02:00
Tobias Koppers 88da3f8ed2 normalize output.trustedTypes to an object 2021-05-10 10:34:21 +02:00
Tobias Koppers a86974b7aa rename to CreateScriptUrlRuntimeModule to have same name as RuntimeGlobal 2021-05-10 10:09:18 +02:00
Tobias Koppers 869f9c8a8c use createScriptUrl only when needed 2021-05-10 09:58:27 +02:00
Tobias Koppers 4b1592d07a rename createScriptURL to createScriptUrl 2021-05-10 09:09:34 +02:00
Bjarki b6e112dabe Only expose createScriptURL function from Trusted Types policy
Since createScriptURL is the only function that is used on webpack's
Trusted Types policy, replace the getTrustedTypesPolicy global with a
simpler createScriptURL global.

In terms of compiled code, this replaces the non-minifiable
tt().createScriptURL(url) with tu(url), which is more compact in terms
of code size.
2021-05-04 16:26:22 +02:00
Bjarki c71184958d Move Trusted Types policy into TrustedTypesRuntimeModule
Also make the policy available at runtime through
RuntimeGlobals.getTrustedTypesPolicy(), and update runtime dependencies
accordingly.
2021-05-04 16:12:41 +02:00
Tobias Koppers 2df8267220 handle falsy entry options correctly 2021-04-14 20:21:17 +02:00
Tobias Koppers 38de0dbf4e allow to specify `publicPath` for each entrypoint 2021-04-14 16:38:01 +02:00
Tobias Koppers 393913dbd8 rename files, avoid indenting runtime code 2021-03-09 09:42:01 +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 5d57777a5e add `parser.url: "relative"` option
this will generate URLs without base uri for `new URL`
publicPath is still added
2021-02-16 19:04:16 +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 65f1fb4d93 add to change base URI at runtime
fix missing runtime requirement for base uri
2021-02-05 16:17:18 +01:00
Tobias Koppers 495cabb94d improve TLA consistency 2021-01-29 13:51:32 +01:00
Tobias Koppers 7661ad868a generate code that executes depending on runtime
fixes #11770
2020-10-27 06:30:49 +01:00
Tobias Koppers b8950e8581 output.chunkFilename can be a function 2020-09-25 16:03:05 +02:00
Tobias Koppers aa74705297 split auto publicPath into separate module 2020-09-18 10:13:31 +02:00
Tobias Koppers b5719c57e2 improve public path runtime module 2020-09-18 09:48:53 +02:00
Tobias Koppers c67e03abc7 move undo path to runtime module
fix escaping in output code
fix missing contentHashType
2020-09-18 09:10:10 +02:00
Ivan Kopeykin 49009486df support undo path 2020-09-16 23:20:44 +03:00
Ivan Kopeykin fad7712bba support output.importFunctionName 2020-09-15 21:03:05 +03:00
Ivan Kopeykin 580de0873a update publicPath
- support option output.publicPath="auto"
- add test cases
- render import.meta.url for output.scriptType="module"
2020-09-15 00:27:38 +03: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 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 115aa13577 improve compat for MainTemplate jsonp hooks
improve compat for MainTemplate runtime hooks

fixes #10826
2020-07-03 09:44:55 +02:00
Tobias Koppers 531f7b47f6 move script loading into separate runtime module
attach to existing script tags
2020-06-04 03:01:22 +02:00
Tobias Koppers a468cbbd2e add provide shared module plugin 2020-05-23 16:08:51 +02:00
Joel Denning 76d5cd579c Exposing System.register _context variable to bundled code.
Making __system_context__ available to code splits.

Fixing git problem

Making PR compatible with webpack 5

Undoing prettier changes to open-bot

Adding test

Triggering build

Triggering build

Reimplementing with new file

Exposing System.register _context variable to bundled code.

Making __system_context__ available to code splits.

Making PR compatible with webpack 5

Undoing prettier changes to open-bot

Adding test

Triggering build

Triggering build

Self review

Self review

Fixing license

Removing deleted file

Fix
2020-02-29 15:24:52 -07: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 faf784b6ab refactor hop runtime helper 2019-12-03 16:27:39 +03:00
Tobias Koppers f67d5df8b3 fix hashing for runtime modules 2019-11-14 20:58:01 +01:00
Tobias Koppers ddc3dae0e6 refactor Module.source() and Module.getRuntimeRequirements() into Module.codeGeneration
add code generation phase to Compilation
add `output.iife` options to remove iife wrapper
add `experiments.outputModule` which enabled `output.module`
add `output.module` which sets defaults to `output.iife: false`, `output.libraryTarget: "module"`, `output.jsonpScriptType: "module"`, `terserOptions.module: true`
add `output.module` example
improve runtime requirements needed by ConcatenatedModule
add entry inlining, which inlines entry module code into runtime scope (only when safe)
make whole bundle strict when all modules are strict
2019-10-08 23:59:48 +02:00
Tobias Koppers 53f68c9e7b update deprecated usage of chunk and main templates 2019-10-08 23:46:33 +02:00