Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple worker directories #1607

Closed
1 task
florian-milky opened this issue May 5, 2023 · 5 comments · Fixed by #1832
Closed
1 task

Add support for multiple worker directories #1607

florian-milky opened this issue May 5, 2023 · 5 comments · Fixed by #1832
Labels
Milestone

Comments

@florian-milky
Copy link

Scope

Improves an existing behavior

Compatibility

  • This is a breaking change

Feature description

In my project I have several directories where I use msw (storybook and test for example).
At the moment I can only define one workerDirectory, so only one of my files get updated with new versions.
Suggestion: allow a workerDirectories option or allow workerDirectory to take an array of strings

@kettanaito
Copy link
Member

Hi, @florian-milky. That's a great suggestion! I will try to add it to the upcoming major release.

Would the following API work for you?

{
  "msw": {
    "workerDirectory": ["./public", "./storybook/static", "foo/bar"]
  }
}

@kettanaito
Copy link
Member

Thinking about this, I think the best strategy is to ship this incrementally after the next release. This will have backward compatibility and will support a plain string as a value as well (I see no reason not to do that). May be one of the good issues to pick up after the release.

@florian-milky
Copy link
Author

@kettanaito Sounds great! Thank you!

@zigang93
Copy link

It will be awesome for monorepo setup, can't wait for next major update release

@kettanaito
Copy link
Member

Released: v2.1.0 🎉

This has been released in v2.1.0!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants