npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

import-http-webpack-plugin

v3.1.21

Published

This enables webpack4 to import remote resources in a synchronous manner, optimizing the development experience, construction speed and publishing efficiency.

Readme

import-http-webpack-plugin

This enables webpack4 to import remote resources in a synchronous manner, optimizing the development experience, construction speed and publishing efficiency.

中文文档

It is recommended to use "mf-webpack4" in line with the present and future ecology

characteristic:

  1. Support the use of single instance and multiple instances of the same package. The same package can use multiple different versions at the same time.

  2. Support the introduction of packages with "amd", "UMD", "system" and other module specifications built by others.

Online attempt (including development hot update): https://stackblitz.com/github/wpmjs/import-http-webpack-plugin/tree/main/examples/hot-refresh?file=app2%2Fsrc%2FApp2.jsx

Usage:

import React from "https://unpkg.com/react@17/umd/react.development.js"
import json from "https://unpkg.com/[email protected]/package.json"
const vue = import("https://unpkg.com/[email protected]/dist/vue.js")

;(async function () {
  console.log('json:', json)
  console.log('react:', React)
  console.log('vue:', await vue)
})()

Configuration:

// webpack.config.js
module.exports = {
  plugins: [
    new ImportHttpPlugin({
      init: {
        resolvePath(request) {
          return "https://unpkg.com/" + request.name + (request.version ? "@" + request.version : "")
        },
        resolveEntryFile(request) {
          return "/dist/index.js"
        }
      },
      /**
       * Configure remote dependencies used in this build
       * There are two types of remote configurations:
       */
      remotes: {
        // 1. Use remote packages
        // Remote key, regardless of configuration“ react@17 "Or" react "will make all" react "in the project use remote dependencies
        // Example: if multiple projects need to use different versions of react, you need to use“ react@version "This way
        "react@17": "https://unpkg.com/react@17/umd/react.development.js",
        "react-dom": "https://unpkg.com/react-dom/umd/react-dom.development.js",
        "react-refresh/runtime": "https://unpkg.com/react-refresh-umd@0",
        "react-refresh": "https://unpkg.com/react-refresh-umd@0",

        //2. Use the unified package management platform
        "test": "test",
      },
      /**
       * Remote package in dev mode, such as react.development version for hot update during development
       */
      devRemotes: {
        "react@17": "https://unpkg.com/react@17/umd/react.development.js",
        "react-dom": "https://unpkg.com/react-dom@17/umd/react-dom.development.js",
      },
      defineRemotes: {
        // If the remote package used is not self built and the package has dependencies, you need to configure dependency mapping here
        "react-dom": {
          "deps": [
            "react-refresh/runtime",
            { name: "react", target: "react@17" }
          ]
        }
      },
      injects: [
        "https://unpkg.com/wpmjs@2/dist/index.js",
      ],
    })
  ]
}

If you need to generate multiple instances of a package, that is, different versions appear at the same time, you need to see the following example. If you need a single instance, you don't need to pay attention to it

Remote single instance and multi instance configurations are determined by the identifier at the key, as shown in the following three webpack.config JS, which are 【a】, 【b】 and 【C】 in the order of introduction:

*【A】 The "react" of 【a】 and 【b】 projects will use the first registered“ react@17 "Corresponding" https://unpkg.com/react @17/umd/react.development. JS "in this version, the" react "reference in the two projects is a singleton *【B】 If the project is used independently or introduced before the project 【a】“ react@17 "Can use" https://unpkg.com/react/umd/react.development.js "This version *【A】 And "react" of 【c】 project will use "XX. Com"/ react@17 /umd/xx.js"、"xx.com/ react@18 /umd/xx. JS "there are many" react "references in these two versions and two projects

// webpack.config.A.js
remotes: {
    "react@17": "https://unpkg.com/react@17/umd/react.development.js"
}

// webpack.config.B.js
remotes: {
    "react@17": "https://unpkg.com/react/umd/react.development.js"
}

// webpack.config.C.js
remotes: {
    "react": "http://https://unpkg.com/react@18/umd/react.development.js"
}