Registry / web-framework / importmap-plugin

importmap-plugin

JSON →
library0.8.0jsnpmunverified

Rollup/Vite plugin for generating import maps for SystemJS or ES module outputs. Current stable version 0.8.0. Designed to work exclusively with Rollup's output plugins, it maps module chunks to URLs in an import map and injects the map into an HTML file. Key differentiators: supports both SystemJS and ES module formats, integrates with Vite's build pipeline. Note: this is a proof-of-concept with limited API surface and no active release cadence.

npm install importmap-plugin
INSTALL
IMPORT
SIG · IMPORTMAP-PLUGIN
I
importmap-plugin
web-frameworkjavascriptv0.8.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import ImportmapPlugin from 'importmap-plugin'
const ImportmapPlugin = require('importmap-plugin')
ESM-only package; default export is the plugin function.
ImportmapPlugin
import ImportmapPlugin from 'importmap-plugin'
import { ImportmapPlugin } from 'importmap-plugin'
Named export not available; use default import.
type ImportmapOptions
import type { ImportmapOptions } from 'importmap-plugin'
TypeScript type exported for plugin options.

Configures Vite to use importmap-plugin for generating an import map in SystemJS format with external imports enabled.

// vite.config.ts import { defineConfig } from 'vite'; import ImportmapPlugin from 'importmap-plugin'; export default defineConfig({ build: { rollupOptions: { output: { format: 'system', entryFileNames: 'app/index.js', chunkFileNames: 'chunks/[name].js', plugins: [ ImportmapPlugin({ base: '/', external: true, indexHtml: 'index.html', }), ], }, }, }, });
Debug
Known issues
gotchaPlugin must be placed inside Rollup output.plugins, not top-level plugins array.
fix
Move ImportmapPlugin into output.plugins as shown in the quickstart.
affects: >=0.1.0
gotchaentryFileNames and chunkFileNames must not include hash placeholders like [hash]; otherwise import map generation fails.
fix
Omit [hash] from entryFileNames and chunkFileNames.
affects: >=0.1.0
gotchaexternal option only works for SystemJS format; for ES modules set external to false and handle external imports separately.
fix
Set external: true only when format is 'system'.
affects: >=0.1.0
deprecatedProof-of-concept; may not be maintained or receive updates.
fix
Consider alternatives or fork if needed.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Could not resolve 'importmap-plugin'
Package not installed or missing from package.json.
fix
npm install importmap-plugin
TypeError: ImportmapPlugin is not a function
Named import used instead of default import.
fix
Use `import ImportmapPlugin from 'importmap-plugin'`
Upgrade
Version history
0.8.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Bingbot
1
Resources
importmap-plugin — npm install importmap-plugin · libregistry