-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
47 lines (43 loc) · 1.15 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
import { defineConfig, transformWithEsbuild } from 'vite'
import react from '@vitejs/plugin-react'
import { resolve } from "path";
console.log(resolve(__dirname, 'index.html'))
export default defineConfig({
root: 'src',
plugins: [
{
name: 'treat-js-files-as-jsx',
async transform(code, id) {
if (!id.match(/src\/.*\.js$/)) return null
// Use the exposed transform from vite, instead of directly
// transforming with esbuild
return transformWithEsbuild(code, id, {
loader: 'jsx',
jsx: 'automatic',
})
},
},
react(),
],
optimizeDeps: {
force: true,
esbuildOptions: {
loader: {
'.js': 'jsx',
},
},
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, './src/index.html'),
nvo: resolve(__dirname, './src/nvo.html'),
suggest: resolve(__dirname, './src/suggest.html'),
onsbuiten: resolve(__dirname, './src/onsbuiten.html'),
kennisfestival: resolve(__dirname, './src/kennisfestival.html'),
"3ou": resolve(__dirname, './src/3ou.html'),
},
},
outDir: '../dist'
},
})