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

webpack-init-project

v1.0.1

Published

learning webpack completely

Readme

webpack-init-project

Introduction

一个以webpack4为基础的现代工程模版,打造简单易用的webpack环境项目

主要有以下特点:

  1. 支持ES6 jsx 语法 (doing)
  2. 支持vue 语法 (doing)
  3. 可以根据场景需要裁剪或者扩展 (done)

主要包括:

  1. base部分

配置内容详细见webpack.common.js。更多关于:生成css单独文件、CSS Module、css sourceMap等内容可以翻看具体的loader链接

  • 入口文件:
  • App : index.js
  • Common : common.js
  • 默认开启file-loader : file module -> url
  • xml tsv等: 默认未开启处理
  1. 开发环境配置部分

配置内容详细见webpack.dev.js

  1. 生产环境配置部分

配置内容详细见webpack.prod.js

  • mode:'production'
  1. server 部分
  • 使用express创建http服务
  • 使用webpack-dev-middleware,文件变更时实时编译
  • 所有路由重定向到入口文件,使用前端路由导航

Before use

  • 因为默认使用了CSS Module,CSS Module 详细参考

       .normal {
         color: green;
        }
        // without css module:
        import './Button.css';
        buttonElem.outerHTML = `<button class=${normal}>Submit</button>`
        // with css module
        import styles from './Button.css';
        buttonElem.outerHTML = `<button class=${styles.normal}>Submit</button>`

Install

npm install

build

npm run build

start

npm start

TODOLIST

开发一个脚手架,让用户自己选择框架安装,是webpack环境配置更加具有针对性

  1. react
  2. vue
  3. none: 默认不引入框架的配置环境

Design Summary

  • webpack-hot-middle 要想起作用,还要在每一个要监听的入口文件加入webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true