Commit 564a2bf2 authored by nanahira's avatar nanahira

change it to cjs/esm

parent d27525bd
......@@ -47,6 +47,6 @@ deploy_npm:
script:
- apt update;apt -y install coreutils
- echo $NPMRC | base64 --decode > ~/.npmrc
- npm publish . || true
- npm publish . --access public && curl -X PUT "https://registry-direct.npmmirror.com/$(cat package.json | jq '.name' | sed 's/\"//g')/sync?sync_upstream=true" || true
only:
- tags
This diff is collapsed.
......@@ -2,12 +2,17 @@
"name": "typed-reflector",
"version": "1.0.11",
"description": "Metadata reflector with typing support.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"lint": "eslint --fix .",
"build": "tsc",
"test": "jest"
"compile:cjs": "esbuild index.ts --outfile=dist/index.cjs --bundle --sourcemap --platform=node --target=es2019 --external:reflect-metadata",
"compile:esm": "esbuild index.ts --outfile=dist/index.mjs --bundle --sourcemap --platform=neutral --target=esnext --external:reflect-metadata",
"compile:types": "tsc --emitDeclarationOnly --declaration",
"build": "rimraf dist && npm run compile:cjs && npm run compile:esm && npm run compile:types",
"test": "jest --passWithNoTests",
"start": "node dist/index.cjs"
},
"repository": {
"type": "git",
......@@ -32,6 +37,8 @@
"@types/node": "^16.11.11",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"esbuild": "^0.25.8",
"esbuild-register": "^3.6.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1",
......
......@@ -2,7 +2,7 @@
"compilerOptions": {
"outDir": "dist",
"module": "commonjs",
"target": "es2021",
"target": "es2019",
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment