Skip to content

Commit

Permalink
add ESM exports in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
akphi committed Oct 3, 2022
1 parent 04295e5 commit 95c5d47
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
testEnvironment: 'node',
testMatch: ['<rootDir>/test/*.test.(ts|js)']
testMatch: ['<rootDir>/test/*.test.(ts|js|cjs)'],
}
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
"module": "./dist/fuse.esm.js",
"unpkg": "./dist/fuse.js",
"jsdelivr": "./dist/fuse.js",
"typings": "./dist/fuse.d.ts",
"types": "./dist/fuse.d.ts",
"type": "module",
"exports": {
".": {
"types": "./dist/fuse.d.ts",
"import": "./dist/fuse.esm.js",
"require": "./dist/fuse.common.js"
}
},
"sideEffects": false,
"files": [
"dist"
Expand All @@ -31,11 +39,11 @@
"dev": "rollup -w -c scripts/configs.js --environment TARGET:umd-dev-full",
"dev:cjs": "rollup -w -c scripts/configs.js --environment TARGET:commonjs-full",
"dev:esm": "rollup -w -c scripts/configs.js --environment TARGET:esm-dev-full",
"build": "rm -r dist && mkdir dist && node ./scripts/build.main.js",
"build": "rm -r dist && mkdir dist && node ./scripts/build.main.cjs",
"test": "jest",
"lint": "eslint src scripts test",
"release": "./scripts/release.sh",
"docs:bump": "node ./scripts/bump-docs.js",
"docs:bump": "node ./scripts/bump-docs.cjs",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"docs:release": "./scripts/deploy-docs.sh",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.main.js → scripts/build.main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path')
const zlib = require('zlib')
const terser = require('terser')
const rollup = require('rollup')
const configs = require('./configs')
const configs = require('./configs.cjs')

if (!fs.existsSync('dist')) {
fs.mkdirSync('dist')
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 95c5d47

Please sign in to comment.