mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
build(utils): 构建产物不将依赖打入
This commit is contained in:
parent
04d7725db9
commit
2173691d7a
@ -19,6 +19,10 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
|
||||
import pkg from './package.json';
|
||||
|
||||
const deps = Object.keys(pkg.dependencies);
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
dts({
|
||||
@ -41,5 +45,12 @@ export default defineConfig({
|
||||
name: 'TMagicUtils',
|
||||
fileName: 'tmagic-utils',
|
||||
},
|
||||
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return deps.some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user