Files
Niklas MischkulnigandGitHub d0777680de Turbopack: Worker chunks (#69734)
Closes PACK-2504
Closes PACK-3020

- Implemented `WorkerAssetReference` to handle `new Worker()` calls
- Added `WorkerLoaderModule` and `WorkerLoaderChunkItem` to create
separate chunk groups for worker scripts
- Updated runtime code to support loading worker scripts
- Modified the analysis process to detect and handle worker creation
- Workers are loaded via blob urls (which then `importScripts`-s all
required chunks), which required introducing a
`TURBOPACK_WORKER_LOCATION` global variable to support the relative
chunk urls in the isolated blob origin.

- [x] `evaluated_chunk_group` is not implemented by
`NodeJsChunkingContext`, so it currently fails to build in RSC/SSR
contexts
	- I've made it ignore worker calls for `Rendering::Server` for now
2024-09-09 12:58:27 +02:00

4 lines
89 B
TypeScript

import('./worker-dep').then((mod) => {
self.postMessage('worker.ts:' + mod.default)
})