/
vite.config.ts
42 lines (41 loc) · 1.05 KB
/
vite.config.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
import { defineConfig } from 'vite'
import rails from 'vite-plugin-rails'
import ViteLegacy from '@vitejs/plugin-legacy'
import ViteReact from '@vitejs/plugin-react'
import WindiCSS from 'vite-plugin-windicss'
import BugsnagPlugins from './plugins/bugsnag'
export default defineConfig({
plugins: [
BugsnagPlugins,
rails({
envVars: {
BUGSNAG_API_KEY: null,
HONEYBADGER_API_KEY: null,
HEROKU_RELEASE_VERSION: 'development',
HEROKU_SLUG_COMMIT: 'main',
},
}),
ViteLegacy({
targets: ['defaults', 'not IE 11'],
}),
ViteReact(),
WindiCSS({
root: __dirname,
scan: {
fileExtensions: ['erb', 'html', 'vue', 'jsx', 'tsx'], // and maybe haml
dirs: ['app/views', 'app/frontend'], // or app/javascript
},
}),
],
// Example: Importing assets from arbitrary paths.
resolve: {
alias: {
'@administrator/': `${process.env.ADMINISTRATOR_ASSETS_PATH}/`,
},
},
server: {
fs: {
allow: [process.env.ADMINISTRATOR_ASSETS_PATH!],
},
},
})