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: copy files to mjs for node compat #58

Merged
merged 2 commits into from
May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
"exports": {
".": {
"types": "./types/index.d.ts",
"import": "./dist/esm/index.js",
"browser": "./dist/cjs/index.js"
"browser": "./dist/esm/index.js",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js"
},
"./pure": {
"types": "./pure.d.ts",
"import": "./dist/esm/pure.js",
"browser": "./dist/cjs/pure.js"
"browser": "./dist/esm/pure.js",
"import": "./dist/esm/pure.mjs",
"require": "./dist/cjs/pure.js"
}
},
"license": "MIT",
Expand Down Expand Up @@ -53,9 +55,10 @@
"toc": "doctoc README.md",
"lint": "eslint src/**/*.js --fix",
"clean": "rimraf dist",
"build": "npm run build:cjs && npm run build:esm",
"build": "npm run build:cjs && npm run build:esm && npm run copy:mjs",
"build:cjs": "babel src --out-dir dist/cjs --config-file ./.babelrc --ignore '**/__tests__/**,**/__mocks__/**'",
"build:esm": "babel src --no-babelrc --out-dir dist/esm --config-file ./.babelrc.esm.json --ignore '**/__tests__/**,**/__mocks__/**'",
"copy:mjs": "cp ./dist/esm/fire-event.js ./dist/esm/fire-event.mjs && cp ./dist/esm/pure.js ./dist/esm/pure.mjs && cp ./dist/esm/index.js ./dist/esm/index.mjs",
"test": "jest src/__tests__ ",
"test:watch": "npm test --watch",
"test:update": "npm test --updateSnapshot --coverage",
Expand Down