-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
49 lines (45 loc) · 1.1 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
49
import { defineConfig, loadEnv } from 'vite';
import { resolve, join } from 'path';
import vue from '@vitejs/plugin-vue';
const postcssConfig = {
plugins: [
require('postcss-import')(),
require('postcss-simple-vars')(),
require('tailwindcss/nesting')(),
require('tailwindcss')(),
require('autoprefixer')(),
],
};
export default defineConfig((mode) => {
const env = loadEnv(mode, '..', '');
const INPUT_DIR = 'src';
const OUTPUT_DIR = join('dist', env.APP1_STATIC_URL_PREFIX);
return {
plugins: [vue()],
resolve: {
alias: {
'@': resolve(INPUT_DIR),
'vue': 'vue/dist/vue.esm-bundler.js',
},
},
root: resolve(INPUT_DIR),
base: join('/static/', env.APP1_STATIC_URL_PREFIX),
css: {
postcss: postcssConfig,
},
server: {
host: env.DEV_SERVER_HOST,
port: env.APP1_DEV_SERVER_PORT,
},
build: {
manifest: true,
emptyOutDir: true,
outDir: resolve(OUTPUT_DIR),
rollupOptions: {
input: {
demoBlock1: join(INPUT_DIR, '/js/apps/demoBlock1.js'),
},
},
},
};
});