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

fix: Fix importing ES module from Node.js (#901) #921

Merged
merged 1 commit into from Apr 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions package.json
Expand Up @@ -3,12 +3,19 @@
"version": "9.0.0-beta.1",
"description": "Create your next immutable state by mutating the current one",
"main": "dist/index.js",
"module": "dist/immer.esm.js",
"module": "dist/immer.esm.mjs",
"exports": {
".": {
"import": "./dist/immer.esm.mjs",
"require": "./dist/index.js"
},
"./*": "./*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this one is needed; there is nothing else to import in immers case.

},
"umd:main": "dist/immer.umd.production.min.js",
"unpkg": "dist/immer.umd.production.min.js",
"jsdelivr": "dist/immer.umd.production.min.js",
"jsnext:main": "dist/immer.esm.js",
"react-native": "dist/immer.esm.js",
"jsnext:main": "dist/immer.esm.mjs",
"react-native": "dist/immer.esm.mjs",
"source": "src/immer.ts",
"types": "./dist/immer.d.ts",
"typesVersions": {
Expand All @@ -32,7 +39,7 @@
"watch": "jest --watch",
"coverage": "jest --coverage",
"coveralls": "jest --coverage && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage",
"build": "rimraf dist/ && tsdx build --name immer --format esm,cjs,umd && yarn build:flow",
"build": "rimraf dist/ && tsdx build --name immer --format esm,cjs,umd && cp dist/immer.esm.js dist/immer.esm.mjs && yarn build:flow",
"build:flow": "cpx 'src/types/index.js.flow' dist -v",
"publish-docs": "cd website && GIT_USER=mweststrate USE_SSH=true yarn docusaurus deploy",
"start": "cd website && yarn start",
Expand Down