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 🙏

© 2026 – Pkg Stats / Ryan Hefner

umi-plugin-script

v1.0.1

Published

向umi 生成的 html 文件中注入,script 文件

Readme

umi-plugin-script

NPM version NPM downloads

解决不知道前端部署的时候 ip 地址需要由现场部署人员配置一些现场的配置参数

相比提取document.ejs提取到pages下面是一种更好的解决方案

保持文件结构整洁,为部署人员提供部署时自定义的配置项

Install

# or yarn
$ npm install
$ npm run build --watch
$ npm run start

Usage

Configure in config/config.js,

export default {
  plugins: [["umi-plugin-script", {
    path?:filepath
  }]]
};

更具 umi 的目录约束

资源文件在 public/ 下面

所以 path 写成 config/index.js

代表项目中的 public/config/index.js

Options

| 参数 | 必填 | 默认值 | 备注 | | ---- | ------ | --------------- | --------------------------------------------------------------------------------------- | | path | 非必填 | config/index.js | path 可以是"config/config.js"或者是 [“config/config1.js”,"config/config2.js"] |

Warnning

如何使用插件后页面出现 umi Uncaught SyntaxError: Unexpected token < 报错,请检查引入的 script 的文件是否存在!

LICENSE

MIT