-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
43 lines (38 loc) · 875 Bytes
/
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
import { defineConfig } from 'vite';
import { replaceData, isProd } from './vite/app.js';
import { base, build } from './vite/build.js';
import { absPath } from './vite/path.js';
import { server, preview } from './vite/server.js';
import css from './vite/css.js';
import htmlmin from './vite/htmlmin.js';
import htmlTransformBase from './vite/html-transform-base.js';
import imagemin from './vite/imagemin.js';
import twig from './vite/twig.js';
import vituum from './vite/vituum.js';
const plugins = [
vituum(),
twig(),
];
if (isProd) {
plugins.push(imagemin());
plugins.push(htmlmin());
plugins.push(htmlTransformBase());
}
export default defineConfig({
// APP CONFIG
envPrefix: 'APP_',
define: replaceData,
css,
plugins,
resolve: {
alias: {
'@': absPath.src,
},
},
// BUILD
base,
build,
// SERVE
server,
preview,
});