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

better-cli

v1.0.4

Published

better-cli

Readme

webpack + Vue多页面应用脚手架

使用方式

npm i -g better-cli
bcli init helloworld
cd helloworld
npm i
npm run dev

webpackTpl模版项目地址

开发规范

项目结构按照xxx.html对应src/xxx文件夹规范开发。一个html页面文件对应src下同名的目录

已有功能

  • [x] 自动分析加载不同页面所需要的第三方模块,防止重复打包
  • [x] 支持postcss处理浏览器兼容性问题
  • [x] 支持sass less 等css预处理器
  • [x] 开发环境热重载
  • [x] 生产环境css提取为单独文件 静态资源文件压缩
  • [x] babel使用transform-runtime代替polyfill,按需加载使用到的babel特性大大减少打包文件体积
  • [x] 预置常用babel插件
  • [x] vue-router使用懒加载,减少初次加载的文件体积
  • [x] 根据生产环境和开发环境使用不同版本的vue源文件
  • [x] 执行 npm run analyze 生成可视化打包文件
  • [x] webpack关键配置处皆附有注释,可根据实际需要修改配置

后续考虑支持功能

  • [ ] 支持React多页面应用
  • [ ] 加入Vue服务端渲染
  • [ ] 引入Dll加快构建速度
  • [ ] 升级到webpack4

内置babel插件

文章总结

webpack+Vue多页面应用打包优化实战

优化前后对比

不对多页面应用做任何优化

优化前 可以看出,只有app-page页面用到了vue-router但是out-page页面也加载了vendor.js中的vue-router

对多页面应用做分离打包优化

优化后 可以看出vue-router被单独打包到vendor-app.js文件并且只在app-page页面v中加载, axios被单独打包到vendor-out.js中并且只在out-page页面加载