Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

import-map-overrides

single-spa68.1kMIT6.1.0

readme

import-map-overrides

A browser and nodejs javascript library for being able to override import maps. This works with native browser import maps, SystemJS import maps, es-module-shims import maps, and more.

Motivation

import map overrides 3

Import maps are a way of controlling which url to download javascript modules from. The import-map-overrides library allows you to dynamically change the url for javascript modules by storing overrides in local storage. This allows developers to override individual modules to point to their localhost during development of a module, without having to boot up a local environment with all the other modules and a backend server.

You should not use import-map-overrides as the only import map on your page, since you cannot count on everyone's local storage having valid values for all of your modules. Instead, import-map-overrides should be viewed as a developer experience enhancement and dev tool -- developers can develop and debug on deployed environments instead of having to boot up a local environment.

Here are some tutorial videos that explain this in more depth:

Documentation

The UI for import-map-overrides works in evergreen browsers (web components support required). The javascript API works in IE11+.

Browser

NodeJS

Contributing

Make sure you commit a changeset with pnpm changeset before you open a PR. This will allow to automatically bump the version and maintain the CHANGELOG once released.

changelog

import-map-overrides

6.1.0

Minor Changes

6.0.1

Patch Changes

6.0.0

Major Changes

5.1.1

Patch Changes

5.1.0

Minor Changes

  • #131 1e066a2 Thanks @joeldenning! - Support for style-nonce attribute on import-map-overrides-popup and import-map-overrides-list custom elements

Patch Changes

5.0.0

Major Changes

  • #126 2241fed Thanks @agevry! - The css for import-map-overrides UI is no longer injected into the main page, but only within the shadow dom for the UI

Minor Changes

  • #126 2241fed Thanks @agevry! - Add style-nonce attribute to import-map-overrides-full element to support use under a Content Security Policy(CSP)

4.2.0

Minor Changes

  • #121 1381dc0 Thanks @joeldenning! - Add new getOverrideScopes API for inheriting scoped dependencies for overridden modules

4.1.0

Minor Changes

  • #117 a7c7970 Thanks @joeldenning! - New use-injector attribute on <meta type="importmap-type"> element

    New resetDefaultMap js api

4.0.1

Patch Changes

4.0.0

Major Changes

  • #104 fa6a22c Thanks @artygus! - Disable query parameter overrides, by default. Add support for allow-query-param-override attribute to <meta> element, to opt-in to query parameter overrides.

  • #112 0b60e71 Thanks @joeldenning! - Upgrade rollup build from v2 to v4. Upgrade cookie dependency from 0.4 to 0.6. Upgrade all devDependencies

3.1.1

Patch Changes