Skip to content

Commit

Permalink
support commonjs
Browse files Browse the repository at this point in the history
  • Loading branch information
aidlran committed Jan 21, 2024
1 parent fc7b88c commit d830090
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@
"repository": "github:aidlran/adamant",
"bugs": "https://github.com/aidlran/adamant/issues",
"homepage": "https://github.com/aidlran/adamant#readme",
"main": "./dist/signal/index.js",
"types": "./dist/signal/index.d.ts",
"main": "./dist/cjs/signal/index.js",
"types": "./dist/cjs/signal/index.d.ts",
"type": "module",
"sideEffects": false,
"files": [
"./dist"
],
"exports": {
".": {
"types": "./dist/signal/index.d.ts",
"default": "./dist/signal/index.js"
"import": {
"types": "./dist/mjs/signal/index.d.ts",
"default": "./dist/mjs/signal/index.js"
},
"require": {
"types": "./dist/cjs/signal/index.d.ts",
"default": "./dist/cjs/signal/index.js"
}
}
},
"scripts": {
"build": "rm -dr dist; tsc",
"build": "rm -dr dist; tsc && npm run build:cjs",
"build:cjs": "tsc --module commonjs --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
"lint": "publint",
"prepack": "npm run build",
"start": "tsc --watch --preserveWatchOutput"
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"module": "NodeNext",
"outDir": "./dist/mjs",
"sourceMap": true,
"strict": true,
},
Expand Down

0 comments on commit d830090

Please sign in to comment.