#1297·msw

Make worker autoupdate an explicit choice

Author: kettanaitoCreated Jun 16, 2022Updated Sep 7, 2026
LabelsfeatureDXchore

Scope

Improves an existing behavior

Compatibility

  • This is a breaking change

Feature description

Current behavior

This package has a postinstall script that auto-copies the worker script to the consumer's specified directory. Executing arbitrary scripts in NPM packages is not a good idea.

Expected behavior

The consumer should instead include the auto-update functionality in their package.json as an explicit command they wish to have any time they reinstall dependencies:

json
{
  "scripts": {
    "postinstall": "npx msw update-worker"
  }
}

Possible CLI command names:

  • update-worker
  • autoupdate