-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.example.ts
43 lines (42 loc) · 1 KB
/
vite.config.example.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
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import { resolve } from 'node:path';
import dts from 'vite-plugin-dts';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
build: {
emptyOutDir: true,
outDir: resolve(__dirname, '.example'),
},
css: {
modules: {
localsConvention: 'camelCaseOnly',
},
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
plugins: [
dts({
tsconfigPath: resolve(__dirname, 'tsconfig.example.json'),
}),
react(),
tsconfigPaths({
configNames: ['tsconfig.example.json'],
}),
],
resolve: {
alias: {
// resolutions needed for sass, typescript resolutions handled by the vite-tsconfig-paths plugin
'@example/styles': resolve(__dirname, 'example/styles'),
'@fonts': resolve(__dirname, 'src/fonts'),
'@styles': resolve(__dirname, 'src/styles'),
},
},
root: 'example',
server: {
port: 8080,
},
});