Skip to content

Commit a1dadf4

Browse files
committed
build: build type declarations using tsc instead of vite-plugin-dts
1 parent 83fa8d3 commit a1dadf4

File tree

4 files changed

+17
-90
lines changed

4 files changed

+17
-90
lines changed

packages/core/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"test": "vitest run",
2222
"check-es6": "es-check es2017 dist/index.js",
2323
"check-treeshake": "agadoo dist/index.mjs",
24-
"build": "vite build",
24+
"build:types": "tsc --project tsconfig.build.json",
25+
"build": "vite build && npm run build:types",
2526
"postbuild": "npm run check-es6 && npm run check-treeshake",
2627
"publish": "clean-publish"
2728
},
@@ -30,7 +31,7 @@
3031
],
3132
"main": "dist/index.js",
3233
"module": "dist/index.mjs",
33-
"types": "dist/index.d.ts",
34+
"types": "dist/types/index.d.ts",
3435
"sideEffects": false,
3536
"dependencies": {
3637
"async-queue-chain": "^1.0.1",
@@ -51,7 +52,6 @@
5152
"clean-publish": "4.0.0",
5253
"es-check": "6.2.1",
5354
"vite": "2.9.1",
54-
"vite-plugin-dts": "1.0.5",
5555
"vitest": "0.9.3",
5656
"vue": "3.2.33",
5757
"vue-router": "4.0.14",

packages/core/tsconfig.build.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"emitDeclarationOnly": true,
6+
"declarationDir": "dist/types"
7+
},
8+
"include": [
9+
"src/**/*.ts"
10+
],
11+
"exclude": [
12+
"src/**/*.spec.ts"
13+
]
14+
}

packages/core/vite.config.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineConfig } from 'vite';
2-
import dts from 'vite-plugin-dts';
32

43
import packageJson from './package.json';
54

@@ -28,7 +27,4 @@ export default defineConfig({
2827
target: 'es2017',
2928
minify: false,
3029
},
31-
plugins: [
32-
dts(),
33-
],
3430
});

pnpm-lock.yaml

-83
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)