-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config-prod.ts
43 lines (41 loc) · 984 Bytes
/
vite.config-prod.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
37
38
39
40
41
42
43
import pkg from './package.json';
import { resolve } from "path";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
const banner = `
/**!
IconPicker ${pkg.version} | ${pkg.description}
@author ${pkg.author.name} (${pkg.author.url})
@version ${pkg.version}
@license ${pkg.license}
*/
`;
export default defineConfig({
build: {
outDir: 'lib',
lib: {
entry : resolve(__dirname, "src/index.ts"),
formats: ['es', 'umd'],
name: "IconPicker",
fileName(format, entryName) {
let strFormat = '';
if (format != 'es' ) {
strFormat = `.${format}`;
}
return `${entryName}${strFormat}.js`;
},
},
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name == 'style.css') {
return 'css/styles.css';
}
return `[name][hash][extname]`;
},
banner: banner
},
}
},
plugins: [dts()],
});