It appears that Rollup offers a feature called output.inlineDynamicImports, which allows for inlining dynamic imports instead of generating new chunks to form a single bundle. However, this can only be achieved when a single input is supplied.
This will inline dynamic imports instead of creating new chunks to create a single bundle. Only possible if a single input is provided
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
rollupOptions: {
output: {
inlineDynamicImports: true
},
},
},
})
https://i.sstatic.net/Cbdbss3r.png