Commit Graph

88 Commits

Author SHA1 Message Date
Tobias Koppers aca0ee5073
Merge pull request #13137 from webpack/feature/public-path-entry
allow to specify `publicPath` for each entrypoint
2021-04-14 18:22:59 +02:00
Tobias Koppers 38de0dbf4e allow to specify `publicPath` for each entrypoint 2021-04-14 16:38:01 +02:00
Tobias Koppers d808d04d26 attach the chunk graph to RuntimeModules 2021-04-14 12:26:35 +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
Tobias Koppers 7dc945f147 allow to place runtime outside of the output path 2021-03-16 13:07:58 +01:00
Tobias Koppers 99ab8bc7a9
Merge pull request #12610 from anshumanv/12577
fix: prefix public path in importScripts
2021-03-15 17:02:41 +01:00
Anshuman Verma eb63cb78b6 fix: prefix public path in importScripts 2021-03-15 16:08:59 +01:00
Tobias Koppers 7f4ce2cf1a add expressionFunction helper to choose shortest variant when return value is not relevant 2021-03-15 15:40:30 +01:00
evilebottnawi ea9b9917cd fix: add `;` 2021-03-15 14:42:55 +03:00
evilebottnawi c223b65e7a fix: code 2021-03-15 14:42:55 +03:00
evilebottnawi 57eaf7f23c refactor: code 2021-03-15 14:42:55 +03:00
evilebottnawi ab60c54f3d fix: es5 2021-03-15 14:42:55 +03: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 cc6f3d9113 fix regression when combining library + runtimeChunk + node target
related to https://github.com/vercel/next.js/pull/22187
2021-02-18 15:50:40 +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 b352f20d2d add "first" to SetHelpers 2021-02-09 21:26:30 +01:00
Tobias Koppers 495cabb94d improve TLA consistency 2021-01-29 13:51:32 +01:00
Tobias Koppers d64227af29 re-add chunkId to script loading when available 2021-01-06 10:08:40 +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 d46f945572 fix problem when HMR and different runtimes
allow HMR to work in WebWorkers too
2020-11-28 13:53:32 +01:00
Tobias Koppers cbcd459d19 fix conflicting real imports and type imports 2020-11-26 10:02:59 +01:00
Tobias Koppers ac15f06f2a improve handling of exported Promises 2020-11-16 20:24:54 +01:00
Tobias Koppers 590aacc2ae make visible exports from non-harmony modules more consistent
fixes #11995
2020-11-16 17:19:36 +01:00
Tobias Koppers 7661ad868a generate code that executes depending on runtime
fixes #11770
2020-10-27 06:30:49 +01:00
Tobias Koppers f263359fd8 use output.importMetaName for import.meta 2020-09-18 10:55:37 +02:00
Tobias Koppers 2f01aac8ce web worker support for automatic publicPath 2020-09-18 10:31: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
Ivan Kopeykin 9989071dc8 Merge branch 'master' into dynamically-resolve-public-path 2020-09-14 14:22:52 +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
Garrett Johnson c09ba8ce81 remove unneeded assignment 2020-08-18 09:37:22 -07:00
Garrett Johnson 8043085c6e log error instead of throwing error 2020-08-17 17:13:17 -07:00
chenxsan fd19fa90b8 add output.charset option 2020-08-17 20:25:27 +08:00
Garrett Johnson 07cbfa0146 check if window exists 2020-08-05 11:17:33 -07:00
Garrett Johnson 0210a45f30 check if window.document exists 2020-08-05 10:58:17 -07:00
Tobias Koppers a69e5dbba8 fix script loading problem with multiple parallel runtimes 2020-08-03 15:28:43 +02:00
Garrett Johnson 71cc102af1 update error log 2020-08-02 20:54:17 -07:00
Garrett Johnson 94973fd240 access document through window 2020-08-02 20:49:48 -07:00
Garrett Johnson 6807bb6f6d remove untested branch 2020-08-02 20:47:45 -07:00
Garrett Johnson 50941e39c8 throw error in fallback case to inform users. 2020-08-02 17:36:44 -07:00
Garrett Johnson ed501824e2 Add logic for dynamically resolving script paths 2020-07-27 20:18:05 -07: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 02c01d541b a little more defensive in the chunk loading runtime code to avoid crashes 2020-07-02 15:25:24 +02:00
Tobias Koppers 204e104bc2
Merge pull request #11084 from smelukov/rename-json-script-type
rename jsonScriptType to scriptType
2020-06-29 14:34:21 +02:00