Import some modules via importmap
- ✅ Auto embed importmap in index.html
- ✅ Auto generate external modules bundle by esbuild
- ✅ Minify
- ✅ Inline sourcemap
npm install @kanamone/vite-plugin-dynamic-import-with-import-map
The following example makes split react
bundle
// vite.config.ts
import { defineConfig } from 'vite'
import { dynamicImportWithImportMap } from '@kanamone/vite-plugin-dynamic-import-with-import-map'
export default defineConfig({
plugins: [dynamicImportWithImportMap(['react'])],
})
Module dependency resolution doesn't work. Because vite is not execute rollup build phase when serve mode.