Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

常用的loaders和plugins #20

Open
Jason-linjiayu opened this issue May 10, 2021 · 1 comment
Open

常用的loaders和plugins #20

Jason-linjiayu opened this issue May 10, 2021 · 1 comment

Comments

@Jason-linjiayu
Copy link
Owner

No description provided.

@Jason-linjiayu
Copy link
Owner Author

常用的loaders

  • 样式相关的:style-loader、css-loader、less-loader、sass-loade
  • 文件相关的:file-loader 、url-loader
  • 编译相关的:babel-loader、coffee-loader 、ts-loader、vue-loader
  • 检验相关的:mocha-loader、tslint-loader 、eslint-loader

常用的plugin

  • UglifyJsPlugin 压缩和混淆代码。
  • html-webpack-plugin可以根据模板自动生成html代码,并自动引用css和js文件
  • DefinePlugin 编译时配置全局变量,这对开发模式和发布模式的构建允许不同的行为非常有用。
  • extract-text-webpack-plugin 将js文件中引用的样式单独抽离成css文件
  • HotModuleReplacementPlugin 热更新
  • optimize-css-assets-webpack-plugin 不同组件中重复的css可以快速去重
  • happypack:通过多进程模型,来加速代码构建
  • compression-webpack-plugin 生产环境可采用gzip压缩JS和CSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant