Skip to content

Commit

Permalink
Merge branch 'testing-esm'
Browse files Browse the repository at this point in the history
  • Loading branch information
Wanasit Tanakitrungruang committed Mar 10, 2023
2 parents f70be3b + 9eb5f10 commit b0be9ec
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
examples/
node_modules/
.*
benchmark/
coverage/
docs/
docs/
examples/
node_modules/
29 changes: 24 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,24 @@
"preset": "ts-jest"
},
"license": "MIT",
"version": "2.5.1",
"version": "2.6.0-1",
"directories": {
"source": "./src",
"test": "./test"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
}
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"sideEffects": false,
"types": "dist/esm/index.d.ts",
"devDependencies": {
"@types/jest": "^26.0.4",
"@typescript-eslint/eslint-plugin": "^4.7.0",
Expand All @@ -32,17 +43,25 @@
"husky": "^4.2.5",
"jest": "^26.1.0",
"prettier": "^2.0.5",
"run-script-os": "^1.1.6",
"ts-jest": "^26.1.1",
"tsc-esm-fix": "^2.12.4",
"typedoc": "^0.20.36",
"typescript": "~4.2.4"
"typescript": "~4.2.4",
"rimraf": "^3.0.2"
},
"husky": {
"hooks": {
"pre-commit": "npm run prettier && npm run test:silent"
}
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
"build": "rimraf dist && npm run build-cjs && npm run build-esm && npm run add-package.json",
"build-cjs": "tsc -p tsconfig.build.json",
"build-esm": "tsc -p tsconfig.build.esm.json && tsc-esm-fix --target=dist/esm",
"add-package.json": "run-script-os",
"add-package.json:nix": "echo '{\"type\":\"commonjs\",\"sideEffects\":\"false\"}' > dist/cjs/package.json && echo '{\"type\":\"module\",\"sideEffects\":\"false\"}' > dist/esm/package.json",
"add-package.json:windows": "echo {\"type\":\"commonjs\",\"sideEffects\":\"false\"} > dist/cjs/package.json && echo {\"type\":\"module\",\"sideEffects\":\"false\"} > dist/esm/package.json",
"benchmark": "npm run build && node ./benchmark/benchmark.js",
"document": "typedoc",
"prepare": "npm run build",
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.build.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"outDir": "dist/esm"
}
}
6 changes: 5 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
"extends": "./tsconfig.json",
"include": [
"src"
]
],
"compilerOptions": {
"outDir": "dist/cjs",
"module": "commonjs"
}
}
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
"noEmit": false,
"declaration": true,
"stripInternal": true,
"outDir": "dist",
"downlevelIteration": true,
"esModuleInterop": true,
"importHelpers": false,
"module": "commonjs",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"removeComments": true,
Expand Down

0 comments on commit b0be9ec

Please sign in to comment.