diff --git a/packages/vant-area-data/build.js b/packages/vant-area-data/build.js new file mode 100644 index 000000000..f696cf294 --- /dev/null +++ b/packages/vant-area-data/build.js @@ -0,0 +1 @@ +require('../vant-use/build'); diff --git a/packages/vant-area-data/package.json b/packages/vant-area-data/package.json index 6881d2ed7..30b7dc707 100644 --- a/packages/vant-area-data/package.json +++ b/packages/vant-area-data/package.json @@ -2,11 +2,16 @@ "name": "@vant/area-data", "version": "1.1.5", "description": "Vant 省市区数据", - "main": "./lib/index.js", - "typings": "./lib/index.d.ts", + "main": "dist/index.cjs.js", + "module": "dist/index.esm.js", + "types": "dist/index.d.ts", "scripts": { - "build": "rimraf ./lib && tsc", - "release": "pnpm build && npm publish", + "clean": "rimraf ./dist", + "dev": "node ./build.js -w", + "build:types": "tsc -p ./tsconfig.json --emitDeclarationOnly", + "build:bundle": "node ./build.js", + "build": "pnpm clean && pnpm build:bundle && pnpm build:types", + "release": "pnpm build && release-it", "prepare": "pnpm build" }, "publishConfig": { @@ -20,5 +25,16 @@ }, "bugs": "https://github.com/youzan/vant/issues", "author": "chenjiahan", - "license": "MIT" + "license": "MIT", + "devDependencies": { + "esbuild": "^0.13.15", + "release-it": "^14.2.2", + "typescript": "~4.5.2" + }, + "release-it": { + "git": { + "tag": false, + "commitMessage": "release: @vant/area-data ${version}" + } + } } diff --git a/packages/vant-area-data/tsconfig.json b/packages/vant-area-data/tsconfig.json index 12b1beb8b..04da53d75 100644 --- a/packages/vant-area-data/tsconfig.json +++ b/packages/vant-area-data/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig", "compilerOptions": { - "target": "ES2019", - "outDir": "./lib", + "outDir": "./dist", "declaration": true }, "include": ["src/**/*"] diff --git a/packages/vant-use/build.js b/packages/vant-use/build.js index 1f2ff0842..a763c8758 100644 --- a/packages/vant-use/build.js +++ b/packages/vant-use/build.js @@ -11,6 +11,8 @@ function bundleBundle(format) { bundle: true, target: ['chrome53'], outfile, + // preserve Chinese character + charset: 'utf8', external: ['vue'], entryPoints: ['./src/index.ts'], }).then(finish); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3b99bd10..53ad8f4f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,7 +77,14 @@ importers: vue-router: 4.0.12_vue@3.2.21 packages/vant-area-data: - specifiers: {} + specifiers: + esbuild: ^0.13.15 + release-it: ^14.2.2 + typescript: ~4.5.2 + devDependencies: + esbuild: 0.13.15 + release-it: 14.11.6 + typescript: 4.5.2 packages/vant-cli: specifiers: