-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
executable file
·44 lines (42 loc) · 1.4 KB
/
vite.config.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
44
import {defineConfig,loadEnv} from "vite";
import * as path from "node:path";
// @ts-ignore
import postcssMixins from "postcss-mixins";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
build: {
manifest: true,
outDir: 'dist',
rollupOptions: {
output: {
entryFileNames: 'assets/[name].[hash].js',
chunkFileNames: 'assets/[name].[hash].js',
assetFileNames: 'assets/[name].[hash].[ext]',
format: 'esm'
}
}
},
css: {
postcss: {
plugins: [
postcssMixins
]
}
},
define: {
__APP_ENV__: JSON.stringify(env.APP_ENV),
},
resolve: {
alias: {
'@components': path.resolve(__dirname, './src/components'),
'@pages': path.resolve(__dirname, './src/pages'),
'@styles': path.resolve(__dirname, './src/styles'),
'@templates': path.resolve(__dirname, './src/templates'),
'@app-types': path.resolve(__dirname, './src/types'),
'@store': path.resolve(__dirname, './src/store.ts'),
'@utils': path.resolve(__dirname, './src/utils')
},
}
}
});