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

Build for browser, don't bundle msw #13

Merged
merged 2 commits into from
Sep 13, 2023
Merged

Build for browser, don't bundle msw #13

merged 2 commits into from
Sep 13, 2023

Conversation

IanVS
Copy link
Contributor

@IanVS IanVS commented Sep 13, 2023

This solves some problems I was seeing when trying to use the build output in my app. By default, tsup bundles all dependencies in devDependencies if they are imported by your code. I thought that it would ignore any specified in peerDependencies, but that doesn't seem to be the case (I opened egoist/tsup#998 to clarify).

So, this explicitly adds msw to externals, to make sure it's not bundled (we want to use the one installed by the user).

I also added the --platform=browser flag, since we're building for browsers and not node.

This also fixes the main in package.json, and adds a module property for legacy tools that don't understand exports maps.

Copy link

@jasikpark jasikpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cah-brian-gantzler
Copy link
Collaborator

Im going to say I dont know enough about bundling yet to comment

@IanVS IanVS merged commit 1692fb0 into master Sep 13, 2023
2 checks passed
@IanVS IanVS deleted the fix-build branch September 13, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants