@kanamone/vite-plugin-dynamic-import-with-import-map
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@kanamone/vite-plugin-dynamic-import-with-import-map

npm version test

Import some modules via importmap

Features

  1. ✅ Auto embed importmap in index.html
  2. ✅ Auto generate external modules bundle by esbuild
    1. ✅ Minify
    2. ✅ 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.

Readme

Keywords

Package Sidebar

Install

npm i @kanamone/vite-plugin-dynamic-import-with-import-map

Weekly Downloads

517

Version

0.1.2

License

MIT

Unpacked Size

28.8 kB

Total Files

6

Last publish

Collaborators

  • euxn23
  • naporin0624
  • himanoa