Gathering detailed insights and metrics for @eik/rollup-plugin-import-map
Gathering detailed insights and metrics for @eik/rollup-plugin-import-map
Gathering detailed insights and metrics for @eik/rollup-plugin-import-map
Gathering detailed insights and metrics for @eik/rollup-plugin-import-map
Rollup plugin to do build-time import mapping using Eik
npm install @eik/rollup-plugin-import-map
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
328 Commits
1 Forks
2 Watchers
4 Branches
8 Contributors
Updated on Jul 01, 2025
Latest Version
3.0.2
Package Id
@eik/rollup-plugin-import-map@3.0.2
Unpacked Size
12.44 kB
Size
3.79 kB
File Count
6
NPM Version
6.14.11
Node Version
14.15.4
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
Plugin to rewrite bare imports to URLs as defined in import maps
Rollup Eik plugin to support the use of import maps to map "bare" import specifiers in ES modules.
1$ npm install @eik/rollup-plugin-import-map
1import eikImportMapPlugin from "@eik/rollup-plugin-import-map"; 2 3export default { 4 input: "source/main.js", 5 plugins: [eikImportMapPlugin()], 6 output: { 7 file: "build.js", 8 format: "esm", 9 }, 10};
This plugin transforms "bare" import specifiers to absolute URL specifiers in ES modules. The module refered to by the "bare" import specifier will be treated as external and its source will not be included in the bundle but refered to by URL.
The plugin will attempt to read import map URLs from eik.json
if present.
1export default { 2 input: "source/main.js", 3 plugins: [eikImportMapPlugin()], 4 output: { 5 file: "build.js", 6 format: "esm", 7 }, 8};
The path to the location of an eik.json
file can be specified with the path
option.
1export default { 2 input: "source/main.js", 3 plugins: [eikImportMapPlugin({ path: "/path/to/eik-json-folder" })], 4 output: { 5 file: "build.js", 6 format: "esm", 7 }, 8};
The plugin can also be told which URLs to load import maps from directly using the urls
option.
1export default { 2 input: "source/main.js", 3 plugins: [eikImportMapPlugin({ urls: `http://myserver/import-map` })], 4 output: { 5 file: "build.js", 6 format: "esm", 7 }, 8};
Additionally, individual mappings can be specified using the maps
option.
1export default { 2 input: "source/main.js", 3 plugins: [ 4 eikImportMapPlugin({ 5 maps: [{ 6 imports: { 7 "lit-element": "https://cdn.eik.dev/lit-element/v2", 8 } 9 }], 10 }), 11 ], 12 output: { 13 file: "build.js", 14 format: "esm", 15 }, 16};
If several of these options are used, maps
takes precedence over urls
which takes precedence over values loaded from an eik.json
file.
ie. in the following example
1export default { 2 input: 'source/main.js', 3 plugins: [eikImportMapPlugin({ 4 path: '/path/to/eik-json-folder', 5 urls: ['http://myserver/import-map'], 6 maps: [{ 7 imports: { 8 "lit-element": "https://cdn.eik.dev/lit-element/v2", 9 } 10 }], 11 })], 12 output: { 13 file: 'build.js', 14 format: 'esm' 15 } 16};
Any import map URLs in eik.json
will be loaded first, then merged with (and overridden if necessary by) the result of fetching from http://myserver/import-map
before finally being merged with (and overriden if necessary by) specific mappings defined in maps
. (In this case lit-element
)
Bundles will have bare imports mapped to absolute URLs.
Ie. Something like this...
1import { LitElement, html, css } from "lit-element";
Will be mapped to something like this...
1import { LitElement, html, css } from "https://cdn.eik.dev/lit-element/v2";
This plugin takes an import map as options:
option | default | type | required | details |
---|---|---|---|---|
path | cwd/eik.json | string | false | Path to eik.json file. |
urls | [] | array | false | Array of import map URLs to fetch from. |
maps | [] | array | false | Array of import map as objects. |
Any mappings defined by any of the means described above must not occur in the Rollup external
option.
If so, this module will throw.
In other words, this will not work:
1export default { 2 input: "source/main.js", 3 external: ["lit-element"], 4 plugins: [ 5 eikImportMapPlugin({ 6 maps: [{ 7 imports: { 8 "lit-element": "https://cdn.eik.dev/lit-element/v2", 9 } 10 }], 11 }), 12 ], 13 output: { 14 file: "build.js", 15 format: "esm", 16 }, 17};
Copyright (c) 2020 Finn.no
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
26 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 4
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More