mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-30 08:50:51 +01:00
32 lines
820 B
JavaScript
32 lines
820 B
JavaScript
|
// vite.config.js
|
||
|
import react from '@vitejs/plugin-react';
|
||
|
import { resolve } from 'path';
|
||
|
import { defineConfig } from 'vite';
|
||
|
|
||
|
export default defineConfig({
|
||
|
plugins: [ react() ],
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
'@': resolve(__dirname, 'src'),
|
||
|
'~': resolve(__dirname, 'node_modules')
|
||
|
}
|
||
|
},
|
||
|
build: {
|
||
|
assetsInlineLimit: 102400,
|
||
|
rollupOptions: {
|
||
|
output: {
|
||
|
assetFileNames: 'src/assets/[name].[ext]',
|
||
|
manualChunks: id =>
|
||
|
{
|
||
|
if(id.includes('node_modules'))
|
||
|
{
|
||
|
if(id.includes('@nitrots/nitro-renderer')) return 'nitro-renderer';
|
||
|
|
||
|
return 'vendor';
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
})
|