35 lines
772 B
TypeScript
35 lines
772 B
TypeScript
import optimizeLocales from '@react-aria/optimize-locales-plugin';
|
|
import react from '@vitejs/plugin-react';
|
|
import macros from 'unplugin-parcel-macros';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
macros.vite(), // Must be first!
|
|
react({
|
|
babel: {
|
|
plugins: ['babel-plugin-react-compiler'],
|
|
},
|
|
}),
|
|
{
|
|
...optimizeLocales.vite({
|
|
locales: ['en'],
|
|
}),
|
|
enforce: 'pre',
|
|
},
|
|
],
|
|
build: {
|
|
target: ['es2022'],
|
|
cssMinify: 'lightningcss',
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (/macro-(.*)\.css$/.test(id) || /@react-spectrum\/s2\/.*\.css$/.test(id)) {
|
|
return 's2-styles';
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|