-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
36 lines (35 loc) · 1.08 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { copyFileSync } from 'fs';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
export default defineConfig(({ command }) => {
if (command === 'build') {
return {
build: {
minify: false,
lib: {
entry: 'src/hierarchy-list.ts', // Entry point for your package source files
name: 'hierarchy-list', // Name of your package (for UMD/IIFE builds)
formats: ['es', 'cjs', 'umd'],
fileName: 'hierarchy-list',
},
copyPublicDir: false,
rollupOptions: {
output: {
exports: 'named',
}
},
},
plugins: [
dts(),
{
name: "copy-styles",
writeBundle(){
copyFileSync('src/style.css', 'dist/style.css');
}
}
],
};
} else {
return {};
}
});