+24
-2
@@ -9,7 +9,7 @@ import { defineConfig, lazyPlugins } from 'vite-plus';
|
||||
|
||||
const qaBuild = process.env.INVESTMOZ_QA_BUILD === '1';
|
||||
|
||||
export default defineConfig({
|
||||
export default defineConfig(({ command }) => ({
|
||||
// Label the isolated QA browser without changing the active environment/build.
|
||||
define: qaBuild
|
||||
? { 'import.meta.env.VITE_APP_NAME': JSON.stringify('InvesteMoz QA') }
|
||||
@@ -34,12 +34,34 @@ export default defineConfig({
|
||||
inertia(),
|
||||
react(),
|
||||
babel({
|
||||
// Compile React components and hooks, not generated URLs or data utilities.
|
||||
include: [/\.[jt]sx(?:$|\?)/, /[/\\]hooks[/\\].*\.[jt]s(?:$|\?)/],
|
||||
presets: [reactCompilerPreset()],
|
||||
// Keep development debugging; production does not emit source maps.
|
||||
sourceMap: command !== 'build',
|
||||
}),
|
||||
tailwindcss(),
|
||||
// Reuse generated URLs in QA without booting the active Laravel environment.
|
||||
...(!qaBuild ? [wayfinder({ formVariants: true })] : []),
|
||||
]),
|
||||
build: {
|
||||
rolldownOptions: {
|
||||
output: {
|
||||
codeSplitting: {
|
||||
groups: [
|
||||
{
|
||||
name: 'document-word',
|
||||
test: /[/\\]node_modules[/\\]docx[/\\]/,
|
||||
},
|
||||
{
|
||||
name: 'document-zip',
|
||||
test: /[/\\]node_modules[/\\]jszip[/\\]/,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
// Laravel's public/hot points to IPv4 loopback; bind Vite there explicitly.
|
||||
host: '127.0.0.1',
|
||||
@@ -98,4 +120,4 @@ export default defineConfig({
|
||||
entryPoint: 'resources/css/app.css',
|
||||
},
|
||||
},
|
||||
});
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user