Skip to content

Commit 62b8f8c

Browse files
committed
feat(build): enhance build scripts to clean dist directory before building and update Vite configuration
1 parent cf48142 commit 62b8f8c

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@
8181
"scripts": {
8282
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|gql|graphql|mdx)\"",
8383
"format:check": "prettier -l \"**/*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|gql|graphql|mdx)\"",
84-
"build": "vite build",
84+
"build": "rm -rf dist && vite build",
8585
"build:playground": "pnpm -C playground build",
86-
"generate": "vite build",
86+
"generate": "rm -rf dist && vite build",
8787
"lint:main": "eslint --cache --cache-location ./node_modules/.cache/.eslintcache --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx}\" eslint.config.js vite.config.ts --no-warn-ignored",
8888
"lint:playground": "pnpm -C playground lint",
8989
"lint": "pnpm lint:main && pnpm lint:playground",

tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
"forceConsistentCasingInFileNames": true,
66
"module": "esnext",
77
"moduleResolution": "node",
8+
"noEmit": true,
89
"outDir": "dist",
910
"resolveJsonModule": true,
1011
"skipLibCheck": true,
1112
"strict": true,
13+
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo",
1214
"target": "ESNext"
1315
},
1416
"exclude": ["node_modules", "dist", "playground"],

vite.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const packageJson = require('./package.json')
77

88
export default defineConfig({
99
build: {
10+
outDir: 'dist',
1011
lib: {
1112
entry: 'src/index.ts',
1213
formats: ['es'],
@@ -24,6 +25,8 @@ export default defineConfig({
2425
dts({
2526
entryRoot: 'src',
2627
outDir: 'dist',
28+
insertTypesEntry: true,
29+
exclude: ['playground/**', 'vite.config.ts'],
2730
}),
2831
],
2932
})

0 commit comments

Comments
 (0)