8000 Worker entry points using `importScripts` should load synchronously. · Issue #18615 · webpack/webpack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Worker entry points using importScripts should load synchronously. #18615
Open
@tomprince

Description

@tomprince

new StartupChunkDependenciesPlugin({
chunkLoading: "import-scripts",
asyncChunkLoading: true
}).apply(compiler);

It appears that webpack unnecessarily makes loading additional chunks in worker entrypoints asynchronous, given that the method used to load additional chunks is in fact synchronous.

I ran into this trying to create a custom worker for monaco. It uses importScripts to load a file from a given URL, and expects something to be synchronously defined after importScripts has returned (code). This fails if the URL is a webpack bundle generated using importScripts, but it works if I change asyncChunkLoading to false in the above code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0