Skip to content

Commit 138a9db

Browse files
committed
build: build libs
1 parent 63e6e81 commit 138a9db

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

package-lock.json

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@
280280
"vite": "^7.2.6",
281281
"vite-plugin-compression": "^0.5.1",
282282
"vite-plugin-dts": "^4.5.4",
283+
"vite-plugin-static-copy": "^3.1.4",
283284
"vite-plugin-svgr": "^4.2.0",
284285
"web-streams-polyfill": "^4.2.0",
285286
"webpack": "^5.103.0",

vite.config.lib.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import dts from 'vite-plugin-dts'
44
import path from 'path'
55
import { fileURLToPath } from 'url'
66
import { visualizer } from 'rollup-plugin-visualizer'
7+
import { viteStaticCopy } from 'vite-plugin-static-copy'
78

89
const __dirname = path.dirname(fileURLToPath(import.meta.url))
910
const useAnalyze = Boolean(process.env.USE_ANALYZE)
@@ -29,6 +30,15 @@ export default defineConfig({
2930
// 同时显式包含全局声明(例如 *.module.less)
3031
include: ['src/lib', 'src/vite-env.d.ts'],
3132
}),
33+
viteStaticCopy({
34+
targets: [
35+
{
36+
src: 'NPM_README.md',
37+
dest: '.', // 这里 '.' 代表相对于 build.outDir (即 dist-lib) 的根目录
38+
rename: 'README.md',
39+
},
40+
],
41+
}),
3242
// 仅在 USE_ANALYZE=1 时生成体积分布报告
3343
analyzePlugin,
3444
].filter(Boolean),

0 commit comments

Comments
 (0)