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

@hsdata/webpack-config

v1.1.7

Published

### 安装

Downloads

14

Readme

恒生数据 webpack 脚手架

安装

项目局部安装
npm i @hsdata/webpack-config -D / yarn add @hsdata/webpack-config -D
全局安装
npm i @hasdata/webpack-config -g / yarn add @hsdata/webpack-config -g

使用

项目局部使用:
package.json中增加命令行:
{
    "script":{
        "dev": "hsd dev",
        "build": "hsd build"
    }
}
执行: npm run dev /  npm run build


全局使用:
hsd dev / hsd build

使用规范

  • 1.项目根目录下包含 public/index.html 文件,会作为 HtmlWebpackPlugin 插件的页面 template 引入
  • 2.项目根目录下的 babel.config.js、.babelrc 文件删除,脚手架中已集成相关配置项,再次引入会使用项目中的配置,产生冲突

命令

  • hsd dev 开发命令
  • hsd build 打包命令
  • hsd inspect 输出 webpack 配置项
hsd inspect  控制台输出webpack配置项
hsd inspect -o [fileName] webpack配置项输出为文件,默认输出inspect.webpack.js,可以自定义文件
hsd inspect -o -m webpack.config 输出合并后的配置项
hsd inspect --mode=[dev|pro] 输出dev/pro阶段的配置项,默认dev阶段配置
  • hsd move(开发中) 子业务系统打包 dist 目录迁移到主框架

配置项

  • -m/--merge 合并个性化配置项
    {
        "script":{
            "dev": "hsd dev -m webpack.config.js",
            "build": "hsd build -m webpack.config.js",
        }
    }
  • --extract [true/false] 是否提取 css 到独立的文件
hsd dev --extract=true       // dev模式下默认extract不开启
hsd build --extract=false    // build模式下默认extract开启
  • -oss/--ossTosee 打包文件发布到 see 平台(开发中)

脚手架使用错误解决

TypeError: Cannot read properties of undefined (reading 'styles')

vue-loader 升级/降级到 15.10.1

npm i vue-loader@^15.10.1 -D / yarn add vue-loader@^15.10.1 -D

webpack@"^2.0.0 || ^3.0.0 || ^4.0.0" from [email protected]

~~脚手架中依赖的 less-loader 是 5.0.0(项目中大多使用该版本,升级到 6.0.0 会有冲突),在安装时会提示 less-loader 依赖 webpack4 及其以下版本(项目使用 webpack5),可以强制安装~~ 脚手架 0.0.26 版本,less-loader 已升级 6.0.0,使用该版本注意项目中 less-loader 的版本处理

npm i @hsdata/webpack-config -f

忽略脚手架中默认配置

在传入的 webpack 配置文件中增加 ignoreDefault 属性,用来指定忽略哪些内容

ignoreDefault:{
        // 忽略默认插件(已支持)
        plugins:['HtmlWebpackPlugin']
}