Skip to content

Commit

Permalink
Merge pull request #382 from hotoo/feat/amd-umd
Browse files Browse the repository at this point in the history
feat: export amd module
  • Loading branch information
hotoo authored Nov 22, 2023
2 parents 0688722 + 54f61cc commit c75d4e9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 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
2 changes: 1 addition & 1 deletion README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Convert Han to pinyin. useful for phonetic notation, sorting, and searching.
via npm:

```bash
npm install pinyin@alpha --save
npm install pinyin --save
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion README.ko-KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ README: [简体中文](README.md) | [English](README.en-US.md) | 한국어
via npm:

```bash
npm install pinyin@alpha --save
npm install pinyin --save
```

## 사용법
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ README: 简体中文 | [English](README.en-US.md) | [한국어](README.ko-KR.md)
via npm:

```bash
npm install pinyin@alpha --save
npm install pinyin --save
```

## 用法
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 c75d4e9

Please sign in to comment.