@kanamone/vite-plugin-dynamic-import-with-import-map
v0.1.2
Published
Import some module via importmap
Downloads
4,711
Readme
@kanamone/vite-plugin-dynamic-import-with-import-map
Import some modules via importmap
Features
- ✅ Auto embed importmap in index.html
- ✅ Auto generate external modules bundle by esbuild
- ✅ Minify
- ✅ Inline sourcemap
Installation
npm install @kanamone/vite-plugin-dynamic-import-with-import-map
Usage
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'])],
})
Caveats
Module dependency resolution doesn't work. Because vite is not execute rollup build phase when serve mode.