Skip to content

Document webpack change: new Worker() support #3960

@webpack-bot

Description

@webpack-bot

A pull request by @sokra was merged and maintainers requested a documentation change.

See pull request: webpack/webpack#11439


  • add support for async anonymous entrypoints from inside the codebase
  • add worker example
  • move entry options into Entrypoint and receive them from there

This adds support to create entrypoints from AsyncDependenciesBlocks. Might also be useful for other scenarios (@timneutkens interactive)

What kind of change does this PR introduce?
feature

Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
yes

What needs to be documented once your changes are merged?

  • new option ouput.workerChunkLoading controls the chunk loading of workers (default chosen based on output.chunkLoading)
  • some syntax triggers webpack to compile "..." as new entrypoint with ouput.workerChunkLoading as chunk loading mechnism
    • new Worker(new URL("...", import.meta.url), ...) with optional import { Worker } from "worker_threads"
    • navigator.serviceWorker.register(new URL("...", import.meta.url), ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions