-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
41 lines (38 loc) · 999 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
import { defineConfig } from 'vite';
import fable from 'vite-plugin-fable';
import react from '@vitejs/plugin-react';
import { configDefaults } from 'vitest/config';
// https://nojaf.com/vite-plugin-fable/recipes.html#Using-React
// https://nojaf.com/vite-plugin-fable/recipes.html#Fable-Core-JSX
export default defineConfig({
// order of plugins matters, fable needs to be first
plugins: [
fable({
fsproj: "./src/App.fsproj",
jsx: 'automatic'
}),
react({
include: /\.(fs|js|jsx|ts|tsx)$/,
jsxRuntime: "classic"
})
],
root: "./src",
build: {
outDir: "../dist",
sourcemap: 'inline'
},
define: {
// required if u have: `process is undefined`
// while loading react jsoncomponents
'process.env': {}
},
test: {
include: ['**/*.{test,spec}.{js,jsx,ts,tsx,fs}'],
exclude: [...configDefaults.exclude, 'dist', '.idea', '.git', '.cache'],
environment: 'jsdom',
setupFiles: '../vitest.ts',
transform: {
'^.+\\.fs$': 'vite-plugin-fable'
}
}
})