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

webpack-boost

v0.0.7

Published

Webpack-Boost is a convenient config for webpacking you app.

Readme

Webpack-Boost

webpack-boost 是一个简化配置webpack的项目,通过 webpack-boost 可以快速开始一个可用的前端项目构建。

安装

npm install webpack-boost@latest

用法

样例配置

参考项目 vue-webpack-init

示例

pro模式配置
    new wb()
        .setProject('webpack-boost')
        .setPath('static')
        .setPublic('static/project')
        .setEntry({
            main: ['./src/main.js', './style/style.sty'],
            other: ['./src/main.js', './style/style.sty']
        })
        .setHtml([
            {
                template: "./index.html",
                filename: "index.html",
                chunk: ['main']
            },
            {
                template: "./other.html",
                filename: "other.html",
                chunk: ['other']
            }
        ])
        .pro()
        .hook(function(){
            this.config.postcss.push(require('cssnano'))
        })
        .run()
打包 out 目录
static
├── index.html
├── other.html
└── webpack-boost
    ├── main.31ad98b4c9c06d325196.js
    ├── main.css
    ├── other.31ad98b4c9c06d325196.js
    └── other.css
生成index.html
<head>
    <link href="/static/projects/teststatic/main.css" rel="stylesheet">
</head>
<script src="/static/projects/teststatic/main.5c812e77078e23dcee24.js"></script>

部署时,只需将template移动到server, static/webpack-boost 移动到CDN服务器即可。

Ps: 约定静态资源请求路径为 /static/project/webpack-boost

other

  • vue-webpack-initbuild.js 使用一套约定的配置。live 模式用于前后端分离的开发。 dev 模式用于测试部署。 pro 模式用于正式环境。

    • live 通过热更新、代理服务器实现前后端分离和便捷开发。
    • dev 模式通过 publicPath 和 chunkfilename 配置好静态资源加载目录。
    • pro 模式完成压缩/Hash等静态资源的优化。
  • Extract-text-plugin 插件需要同时设置 loader 和 plugin, 否则会出现 loader is used without the corresponding plugin

##api

setPath

设置webpack的build目录, 例如 dist、static

setPublic

设置webpack的publicPath,publicPath是 he public URL address of the output files when referenced in a browser, 或者可以理解为CDN.

setProject

project是 webpack-boost 的一个内部变量,它辅助所有打包生成的静态资源再同一工程目录下,同时辅助配置请求的资源路径。

setEntry

参数是一个对象,配置webpack config的entry,格式和config.entry的配置相同

setHtml

配置 html-webpack-plugin, 配置相同

plugins

配置插件,内部同一个 unshift 方法将新增插件加入配置文件中。

loaders

同 plugins

setExtract

配置 extrac-text-webpack-plugin,这个插件使用过程中需要同时配置loader和plguin,因此,如果覆写 module.exports.plugins 会出现这个问题。

setExtract 接收两个参数,一个是需要配置extname的名单和生成的文件名。

setClean

使用 webpack-clean-plugin 插件清除文件或文件夹。

hook

通过一个钩子函数操作 webpack config

run

运行 webpack

live

通过 webpack-dev-server, 开启热更新。 如果需要配置 dev-only-hot 可fork自行配置。

License

https://opensource.org/licenses/mit-license.php