mirror of
https://github.com/dergigi/boris.git
synced 2026-01-06 16:34:45 +01:00
- Add ssr.noExternal to force pre-bundling of applesauce packages - Add mainFields to resolve module entry points - Add rollupOptions to ensure ESM output format - Workaround for restrictive exports map in applesauce-core@4.0.0
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 9802
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.ts', '.tsx', '.json'],
|
|
conditions: ['import', 'module', 'browser', 'default'],
|
|
// Disable strict package exports resolution to allow Rollup to resolve
|
|
// internal modules in packages with restrictive exports maps
|
|
preserveSymlinks: false,
|
|
mainFields: ['module', 'jsnext:main', 'jsnext', 'main']
|
|
},
|
|
optimizeDeps: {
|
|
include: ['applesauce-core', 'applesauce-factory', 'applesauce-relay', 'applesauce-react'],
|
|
esbuildOptions: {
|
|
resolveExtensions: ['.js', '.ts', '.tsx', '.json']
|
|
}
|
|
},
|
|
build: {
|
|
commonjsOptions: {
|
|
include: [/node_modules/],
|
|
transformMixedEsModules: true
|
|
},
|
|
rollupOptions: {
|
|
output: {
|
|
// Ensure ESM output
|
|
format: 'es'
|
|
}
|
|
}
|
|
},
|
|
// Force pre-bundling of problematic packages
|
|
ssr: {
|
|
noExternal: ['applesauce-core', 'applesauce-factory', 'applesauce-relay']
|
|
}
|
|
})
|
|
|