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 exports field to packages with multiple entrypoints #508

Merged
merged 2 commits into from
Nov 30, 2021

Conversation

markdalgleish
Copy link
Contributor

Fixes the following issue: https://github.com/markdalgleish/preconstruct-node-esm-import-issue. To see the fix working, you can run this repro locally and manually apply the diff seen in this PR to node_modules/@vanilla-extract/sprinkles/package.json.

Related issue on Preconstruct: preconstruct/preconstruct#432

More detail about the exports field and its conditional syntax: https://webpack.js.org/guides/package-exports

I ran into this issue because the Sprinkles runtime was being consumed within an ESM package (i.e. "type": "module") and Node.js doesn't allow directory imports in ESM mode. Instead, all nested import paths need to be explicitly defined in the exports field.

@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2021

🦋 Changeset detected

Latest commit: ed12ec0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@vanilla-extract/css Patch
@vanilla-extract/dynamic Patch
@vanilla-extract/recipes Patch
@vanilla-extract/sprinkles Patch
@vanilla-extract/webpack-plugin Patch
@fixtures/features Patch
@fixtures/low-level Patch
@fixtures/recipes Patch
@fixtures/sprinkles Patch
@fixtures/themed Patch
@fixtures/unused-modules Patch
vanilla-extract-example-webpack-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@markdalgleish markdalgleish merged commit d15e783 into master Nov 30, 2021
@markdalgleish markdalgleish deleted the add-exports-field branch November 30, 2021 05:38
@seek-oss-ci seek-oss-ci mentioned this pull request Nov 30, 2021
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.

2 participants