-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
58 lines (55 loc) · 1.73 KB
/
Copy pathvite.config.ts
File metadata and controls
58 lines (55 loc) · 1.73 KB
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
48
49
50
51
52
53
54
55
56
57
58
import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';
import path from "path";
import tailwindcss from "@tailwindcss/vite";
import packageJson from './package.json';
const ReactConfig = {
// Disable React compiler to reduce memory usage
// babel: {
// plugins: [
// ['babel-plugin-react-compiler'],
// ]
// }
};
export default defineConfig({
define: {
'__APP_VERSION__': JSON.stringify(packageJson.version),
'__BUILD_TIME__': JSON.stringify(new Date().toISOString()),
},
publicDir: false,
base: './',
build: {
outDir: path.resolve(import.meta.dirname, 'dist/assets'), // Output directory for the build
assetsDir: '',
emptyOutDir: true, // Clear the output directory before building
manifest: 'manifest.json', // Generate manifest.json
sourcemap: false, // Disable sourcemaps to reduce memory usage
rollupOptions: {
input: {
app: path.resolve(import.meta.dirname, 'src/assets/js/app.tsx'),
},
output: {
entryFileNames: '[name].js',
assetFileNames: '[name]-[hash][extname]',
manualChunks: {
vendor: ['react', 'react-dom'],
monaco: ['@monaco-editor/react'],
handsontable: ['@handsontable/react', 'handsontable'],
jsoneditor: ['vanilla-jsoneditor']
}
},
},
},
plugins: [
react(ReactConfig),
tailwindcss(),
],
esbuild: {
jsx: 'automatic',
},
resolve: {
alias: {
'@': path.resolve(import.meta.dirname, './src/assets/js'),
},
},
})