Commit 564a2bf2 authored by nanahira's avatar nanahira

change it to cjs/esm

parent d27525bd
...@@ -47,6 +47,6 @@ deploy_npm: ...@@ -47,6 +47,6 @@ deploy_npm:
script: script:
- apt update;apt -y install coreutils - apt update;apt -y install coreutils
- echo $NPMRC | base64 --decode > ~/.npmrc - 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: only:
- tags - tags
This diff is collapsed.
...@@ -2,12 +2,17 @@ ...@@ -2,12 +2,17 @@
"name": "typed-reflector", "name": "typed-reflector",
"version": "1.0.11", "version": "1.0.11",
"description": "Metadata reflector with typing support.", "description": "Metadata reflector with typing support.",
"main": "dist/index.js", "main": "dist/index.cjs",
"typings": "dist/index.d.ts", "module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": { "scripts": {
"lint": "eslint --fix .", "lint": "eslint --fix .",
"build": "tsc", "compile:cjs": "esbuild index.ts --outfile=dist/index.cjs --bundle --sourcemap --platform=node --target=es2019 --external:reflect-metadata",
"test": "jest" "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": { "repository": {
"type": "git", "type": "git",
...@@ -32,6 +37,8 @@ ...@@ -32,6 +37,8 @@
"@types/node": "^16.11.11", "@types/node": "^16.11.11",
"@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0", "@typescript-eslint/parser": "^4.33.0",
"esbuild": "^0.25.8",
"esbuild-register": "^3.6.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^3.4.1",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist",
"module": "commonjs", "module": "commonjs",
"target": "es2021", "target": "es2019",
"esModuleInterop": true, "esModuleInterop": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": 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