You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
1 year ago
|
import { defineConfig } from 'vite'
|
||
|
import react from '@vitejs/plugin-react'
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig({
|
||
|
plugins: [react()],
|
||
|
server: {
|
||
|
host: "0.0.0.0",
|
||
|
},
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
"@": "/src",
|
||
|
},
|
||
|
},
|
||
|
build: {
|
||
|
sourcemap: true,
|
||
|
manifest: true,
|
||
|
chunkSizeWarningLimit: 555,
|
||
|
rollupOptions: {
|
||
|
output: {
|
||
|
manualChunks(id) {
|
||
|
// if (id.includes('antd')) {
|
||
|
// console.info('chunk: ' + id)
|
||
|
// return 'antd-component'
|
||
|
// } else if (id.includes('rc-')) {
|
||
|
// return 'rc-component'
|
||
|
// } else if (id.includes('ant-design')) {
|
||
|
// return 'ant-design'
|
||
|
// } else {
|
||
|
// // console.info('chunk: ' + id)
|
||
|
// }
|
||
|
if (id.includes('node_modules')) {
|
||
|
return id.toString().split('node_modules/')[1].split('/')[0].toString();
|
||
|
}
|
||
|
},
|
||
|
chunkFileNames: (chunkInfo) => {
|
||
|
const facadeModuleId = chunkInfo.facadeModuleId ? chunkInfo.facadeModuleId.split('/') : [];
|
||
|
// const fileName = facadeModuleId[facadeModuleId.length - 2] || '[name]';
|
||
|
return `assets/[name].[hash].js`;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
})
|