-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
44 lines (41 loc) · 1.05 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
import { defineConfig } from 'vitest/config';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import Rails from 'vite-plugin-rails';
import tsconfigPaths from 'vite-tsconfig-paths';
import path from 'path';
const envKeys = {};
for (const k in process.env) {
envKeys[`process.env.${k}`] = JSON.stringify(process.env[k]);
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [Rails(), tsconfigPaths(), svelte()],
build: {
commonjsOptions: { exclude: ['chroma-js'] },
manifest: true,
rollupOptions: {
input: {
main: '~/entrypoints/application.ts',
},
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['test/test_setup.ts'],
alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }],
coverage: {
reporter: ['text', 'json', 'html'],
},
},
server: {
fs: { cachedChecks: false },
},
define: envKeys,
resolve: {
alias: {
'@': path.resolve(__dirname, './app/javascript'),
'@public': path.resolve(__dirname, './public'),
},
},
});