-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
46 lines (43 loc) · 1.2 KB
/
vite.config.js
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
44
45
46
import path from 'path';
import { defineConfig } from 'vite';
import { createVuePlugin } from 'vite-plugin-vue2';
import { name } from './package.json';
import { pascalCase } from "change-case";
import { babel } from '@rollup/plugin-babel';
const filename = name.split('/')[1];
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'index.js'),
name: pascalCase(filename),
fileName: (format) => `${filename}.${format}.js`,
},
rollupOptions: {
external: ['vue'],
output: {
assetFileNames: ({ name }) => {
if(name === 'style.css') {
return `${filename}.css`;
}
return name;
},
globals: {
vue: 'Vue'
},
},
plugins: [
babel({
babelHelpers: 'bundled'
})
]
},
watch: !process.env.NODE_ENV && {
include: [
'./tailwindcss/**/*.js'
]
}
},
plugins: [
createVuePlugin()
],
});