Detalhes do pacote

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

kanamone2kMIT0.1.2

Import some module via importmap

vite

readme (leia-me)

@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.

changelog (log de mudanças)

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

0.1.2

Patch Changes

  • a62ddcf: Fix a bug where import map value is relative path

0.1.1

Patch Changes

  • 0912d55: Fix a bug where include external depenency in bundle

0.1.0

Minor Changes

  • e8012bd: Add support commonjs's named export

Patch Changes

  • e2762c9: Use pnpm@8.15 with corepack
  • 3c79488: Move esbuild from dependencies to peerDependencies
  • 9dbd292: Bump vite version

0.0.6

Patch Changes

  • 662c245: Fix a bug where filename include slash when load scoped package

0.0.5

Patch Changes

  • ea75547: Fixed a bug where the package was not resolved when resolving a hoisted module.

0.0.4

Patch Changes

  • 409beb8: Add types and module section in package.json

0.0.3

Patch Changes

  • e9cd5fc: Fix relase script

0.0.2

Patch Changes

  • 80f4339: Fix broken files section in package.json

0.0.1

Patch Changes

  • f0eaae4: First release