support esm build
Showing
This diff is collapsed.
... | ... | @@ -2,11 +2,15 @@ |
"name": "onedice", | ||
"description": "Node.js implementation of [OneDice](https://github.com/OlivOS-Team/onedice)", | ||
"version": "1.0.8", | ||
"main": "dist/index.js", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"compile:cjs": "esbuild index.ts --outfile=dist/index.cjs --bundle --sourcemap --platform=node --target=es2019", | ||
"compile:esm": "esbuild index.ts --outfile=dist/index.mjs --bundle --sourcemap --platform=neutral --target=esnext", | ||
"compile:types": "tsc --emitDeclarationOnly --declaration", | ||
"lint": "eslint --fix .", | ||
"build": "rimraf dist && tsc", | ||
"build": "rimraf dist && npm run compile:cjs && npm run compile:esm && npm run compile:types", | ||
"test": "jest --passWithNoTests", | ||
"start": "node dist/index.js" | ||
}, | ||
... | ... | @@ -43,6 +47,8 @@ |
"@types/node": "^18.7.6", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"esbuild": "^0.15.5", | ||
"esbuild-register": "^3.3.3", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^3.4.1", | ||
... | ... |
Please register or sign in to comment