-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.mjs
More file actions
36 lines (35 loc) · 1022 Bytes
/
Copy pathvite.config.mjs
File metadata and controls
36 lines (35 loc) · 1022 Bytes
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
import { defineConfig } from 'vite';
import { resolve } from 'node:path';
import { NodePackageImporter } from 'sass';
export default defineConfig(({ mode }) => ({
base: '/static/',
root: 'assets',
server: {
port: 5173,
origin: 'http://localhost:5173',
strictPort: true,
},
build: {
outDir: resolve(__dirname, 'build/static'),
emptyOutDir: true,
manifest: true,
rolldownOptions: {
input: {
main: resolve(__dirname, 'assets/js/main.js'),
},
},
sourcemap: true,
cssMinify: mode !== 'development',
minify: mode !== 'development',
},
css: {
preprocessorOptions: {
scss: {
quietDeps: true,
silenceDeprecations: ['import', 'global-builtin', 'color-functions'],
importers: [new NodePackageImporter()],
loadPaths: [resolve(__dirname, 'node_modules')],
},
},
},
}));