Skip to content

Commit

Permalink
feat: export amd module
Browse files Browse the repository at this point in the history
  • Loading branch information
hotoo committed Nov 22, 2023
1 parent 0688722 commit d79ef07
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Thumbs.db
*.pyo
build
esm
amd
lib
lib2
node_modules
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pinyin",
"version": "3.0.0-alpha.7",
"version": "3.1.0",
"description": "汉语拼音转换工具。",
"main": "./lib/pinyin.js",
"module": "./esm/pinyin.js",
Expand All @@ -23,7 +23,8 @@
"scripts": {
"start": "dumi dev",
"prepublishOnly": "npm run build",
"build": "tsc --downlevelIteration -p tsconfig-es5.json & tsc --downlevelIteration -p tsconfig.json",
"build": "tsc --downlevelIteration -p tsconfig-es5.json & tsc --downlevelIteration -p tsconfig.json & npm run build:amd",
"build:amd": "tsc --downlevelIteration -p tsconfig-amd.json",
"doc:build": "rm -rf ./src/.umi && dumi build",
"doc:deploy": "npm run doc:build && cp CNAME docs-dist/dist && gh-pages -d docs-dist/dist",
"lint": "eslint ./src/ ./test/",
Expand All @@ -46,6 +47,7 @@
"@typescript-eslint/parser": "^5.14.0",
"aurl": "^1.2.0",
"aws-sdk": "^2.1011.0",
"beautify-benchmark": "^0.2.4",
"benchmark": "~1.0.0",
"dumi": "^1.1.30",
"eslint": "^8.11.0",
Expand Down Expand Up @@ -74,6 +76,7 @@
"data",
"lib",
"esm",
"amd",
"index.js"
],
"keywords": [
Expand All @@ -87,5 +90,8 @@
"example": "examples",
"test": "test"
},
"engines": {
"install-node": "^18.0.0"
},
"license": "MIT"
}
8 changes: 8 additions & 0 deletions tsconfig-amd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outFile": "./amd/pinyin.js",
"module": "amd",
"target": "ES5"
}
}

0 comments on commit d79ef07

Please sign in to comment.