Nail Polishing Minions

    TypeScript icon, indicating that this package has built-in type declarations

    1.2.0 • Public • Published


    A snowpack plugin that maps your imports to Skypack or other sources.

    JavaScript Style Guide


    npm install --save-dev snowpack-plugin-import-map
    yarn add --dev snowpack-plugin-import-map

    Quick Start

    Step 1: Modify your snowpack config to include the 'snowpack-plugin-import-map' plugin:

    module.exports = {
      extends: '@snowpack/app-scripts-react',
      plugins: [
            // map of packages to imports (required)
            imports: {
              // import the currently installed version of react-dom from
              'react-dom': true,
              // specify the exact URL to load the dependency from
              react: '^16.13.1',
              // Or, import all top-level dependencies from
              '*': true,
              // (with one exception)
              'a-package': false
            // if true, import-map transforms imports in development mode too. default: false.
            dev: true,
            // supported extensions. default: ['.js', '.jsx','.tsx', '.ts']
            extensions: ['.js', '.jsx','.tsx', '.ts'],
            // use custom cdn URL builder instead of Skypack.
            getCdnURL: (source, version, isDev) => {
              return `${source}/${version.replace(/[^\d.]/g, '')}/umd/${source}.production${isDev ? '.min' : ''}.js`

    Note: we don't recommend using this plugin for mapping one package name to another. For that, Snowpack has import aliases built in.

    Note: if you use custom cdn URL builder, some CDN providers may not handle your package, so you must check the existence of the package yourself.

    Step 2: npx snowpack build or npx snowpack dev

    Transforms this:

    // Before
    import React from 'react'
    import ReactDOM from "react-dom"
      <h1>Hello world!</h1>,

    Into this, which can be run directly in the browser without web_modules deps.

    // After
    import React from "^16.13.1";
    import ReactDOM from "^16.13.1";
      React.createElement("h1", null, "Hello world!"),

    Skypack offers blazing fast downloads and great caching, so it will most likely improve your website's loading time. Packages you import from Skypack are optimized for the user's exact browser, so modern browsers load less code.

    Offloading your dependencies to a CDN also reduces the amount of code your server has to serve—reducing your costs! If you import all dependencies from Skypack, your server will only have to supply your source files. This makes it much easier to deploy your application to a CDN 🎉


    npm i snowpack-plugin-import-map

    DownloadsWeekly Downloads






    Unpacked Size

    21.2 kB

    Total Files


    Last publish


    • zhoukekestar
    • seia