-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.js
48 lines (46 loc) · 1.01 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
47
48
import { defineConfig } from 'vite';
import { resolve } from 'path';
import mpa from 'vite-plugin-mpa';
import autoprefixer from 'autoprefixer';
const plugins =
process.env.NODE_ENV === 'production'
? []
: [
mpa({
scanDir: 'examples',
open: '/examples/',
}),
];
export default defineConfig({
plugins,
css: {
preprocessorOptions: {
scss: {
additionalData: `
@import 'src/core/mixins';
@import 'src/core/functions';
@import 'src/core/variables';
`,
},
},
postcss: {
plugins: [autoprefixer],
},
},
build: {
emptyOutDir: false,
outDir: 'dist/',
target: 'es6',
lib: {
name: 'NeuAxentix',
formats: ['es', 'umd'],
fileName: (format) => (format === 'umd' ? `neu-axentix.min.js` : `neu-axentix.esm.js`),
entry: resolve(__dirname, `src/index.ts`),
},
rollupOptions: {
output: {
assetFileNames: `neu-axentix.min.[ext]`,
},
},
},
});