forked from rowanwins/vue-dropzone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
42 lines (41 loc) · 1.07 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
import { defineConfig } from 'vite'
import { resolve } from 'path';
import vue from '@vitejs/plugin-vue'
import { terser } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';
import css from 'rollup-plugin-css-only';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
css: false, // CSSを別ファイルに抽出
}),
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
preventAssignment: true,
}),
css({ output: 'vue2Dropzone.min.css' }),
process.env.NODE_ENV === 'production' && terser(),
],
build: {
lib: {
entry: resolve(__dirname, './src/index.js'),
name: 'vue3-dropzone',
fileName: (format) => `vue3-dropzone.${format}.js`
},
rollupOptions: {
external: ['vue'],
input: 'src/index.js',
output: {
dir: 'dist',
entryFileNames: 'vue2Dropzone.js',
format: 'umd',
name: 'vue2Dropzone',
sourcemap: true,
globals: {
vue: 'Vue'
}
}
}
},
})