{"id":21458,"library":"importmap-plugin","title":"importmap-plugin","description":"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.","status":"active","version":"0.8.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install importmap-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add importmap-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add importmap-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only package; default export is the plugin function.","wrong":"const ImportmapPlugin = require('importmap-plugin')","symbol":"default","correct":"import ImportmapPlugin from 'importmap-plugin'"},{"note":"Named export not available; use default import.","wrong":"import { ImportmapPlugin } from 'importmap-plugin'","symbol":"ImportmapPlugin","correct":"import ImportmapPlugin from 'importmap-plugin'"},{"note":"TypeScript type exported for plugin options.","wrong":"","symbol":"type ImportmapOptions","correct":"import type { ImportmapOptions } from 'importmap-plugin'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport ImportmapPlugin from 'importmap-plugin';\n\nexport default defineConfig({\n  build: {\n    rollupOptions: {\n      output: {\n        format: 'system',\n        entryFileNames: 'app/index.js',\n        chunkFileNames: 'chunks/[name].js',\n        plugins: [\n          ImportmapPlugin({\n            base: '/',\n            external: true,\n            indexHtml: 'index.html',\n          }),\n        ],\n      },\n    },\n  },\n});","lang":"typescript","description":"Configures Vite to use importmap-plugin for generating an import map in SystemJS format with external imports enabled."},"warnings":[{"fix":"Move ImportmapPlugin into output.plugins as shown in the quickstart.","message":"Plugin must be placed inside Rollup output.plugins, not top-level plugins array.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Omit [hash] from entryFileNames and chunkFileNames.","message":"entryFileNames and chunkFileNames must not include hash placeholders like [hash]; otherwise import map generation fails.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Set external: true only when format is 'system'.","message":"external option only works for SystemJS format; for ES modules set external to false and handle external imports separately.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Consider alternatives or fork if needed.","message":"Proof-of-concept; may not be maintained or receive updates.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install importmap-plugin","cause":"Package not installed or missing from package.json.","error":"Error: Could not resolve 'importmap-plugin'"},{"fix":"Use `import ImportmapPlugin from 'importmap-plugin'`","cause":"Named import used instead of default import.","error":"TypeError: ImportmapPlugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}