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 🙏

© 2024 – Pkg Stats / Ryan Hefner

jc-webpack-config

v1.0.4

Published

- 配置内容: - webpack.base.conf.js - js: babel-loader(其中babel-loader仅支持ES6,请根据需要添加'.babelrc'文件) - css: mini-css-extract-plugin, css-loader, less-loader, sass-loader, stylus-loader,postcss-loader(其他诸如浏览器兼容配置请根据需要添加'.postcssrc'文件,内置有style-loader,需要

Downloads

5

Readme

webpack-common-config

自定义配置的webpack工具

  • 配置内容:
    • webpack.base.conf.js

      • js: babel-loader(其中babel-loader仅支持ES6,请根据需要添加'.babelrc'文件)
      • css: mini-css-extract-plugin, css-loader, less-loader, sass-loader, stylus-loader,postcss-loader(其他诸如浏览器兼容配置请根据需要添加'.postcssrc'文件,内置有style-loader,需要进行内联时可修改源代码)
      • font: file-loader 支持后缀 woff|woff2|eot|ttf|otf (内置有url-loader,需要请对源文件进行修改)
      • picture: file-loader 支持后缀 png|jpg|gif|jpeg (内置有url-loader,需要请对源文件进行修改)
      • html: webpack-html-plugin已配置压缩(支持多页面应用,默认首页html与js在/src/index/中,每个页面都必须有一个index.html与index.js进行唯一标识,还必须在源文件中的entry进行设置)
      • 其他: dist目录清理,命令行提示优化
    • webpack.dev.conf.js

      • 增加eslint-loader,eslint已安装alloy,其余配置请根据需要添加'.eslintrc'文件
      • 支持热更新
      • devtool使用"cheap-source-map"
    • webpack.prod.conf.js

      • 支持css文件压缩
      • 支持文件指纹
      • 支持TreeShaking
      • 支持ScopeHoisting

安装教程

npm i webpack webpack-cli js-webpack-config -D

配置教程

  • 创建 webpack.dev.conf.js
    • module.exports = require("jc-webpack-config/lib/webpack.dev.conf")
  • 创建 webpack.prod.conf.js
    • module.exports = require("jc-webpack-config/lib/webpack.prod.conf")
  • 其他配置文件诸如 .babelrc,.browerslistrc,.eslintrc,.eslintignore可直接复制源文件目录下的文件
  • 在package.json中scripts替换成如下内容
    • "scripts": {"test": "echo \"Error: no test specified\" && exit 1","build": "webpack --config lib/webpack.prod.conf.js","dev": "webpack-dev-server --config lib/webpack.dev.conf.js --open","lint": "eslint --fix src"},