We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
HI,各位小伙伴,不定期更新的 webpack 文档更新日志来了哦。本次更新日志干货满满,希望对准备升级和已经在升级过程中的小伙伴有所帮助。 请大家在阅读文档时,认准 https://webpack.docschina.org
HI,各位小伙伴,不定期更新的 webpack 文档更新日志来了哦。本次更新日志干货满满,希望对准备升级和已经在升级过程中的小伙伴有所帮助。
请大家在阅读文档时,认准 https://webpack.docschina.org
在说更新日志前,说两个较为重要的点:
webpack-dev-server
raw-loader
file-loader
url-loader
启动 devServer 的方式由 webpack-dev-server 变更为 webpack serve
webpack serve
# 旧的启动方式 webpack-dev-server --content-base ./dist # 现在的启动方式 webpack serve --content-base ./dist
如需升级 webpack 5 的小伙伴,请周知。
举个简单的例子,大家就明白用法了:
const path = require('path'); module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist'), }, module: { rules: [ { test: /\.css$/i, use: ['style-loader', 'css-loader'], }, { test: /\.(png|svg|jpg|jpeg|gif)$/i, type: 'asset/resource', // 新方式 }, ], }, };
最后,附上两个文档链接:
devServer.color
devServer.socket
ignoreWarnings
stats.warningsFilter
'none'
--progress
profile
--progress=profile
micromatch
glob-to-regexp
'javascript/auto'
configuration-types
我们将为你带来最前沿的前端资讯。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在说更新日志前,说两个较为重要的点:
webpack-dev-server
的启动方式发生了变化;raw-loader
、file-loader
以及url-loader
等 loader 处理,可直接使用全新的 资源模块(Asset Modules)。devServer 的变化
启动 devServer 的方式由
webpack-dev-server
变更为webpack serve
如需升级 webpack 5 的小伙伴,请周知。
资源模块(Asset Modules)
举个简单的例子,大家就明白用法了:
最后,附上两个文档链接:
英文篇
内容更新
配置
devServer.color
的说明devServer.socket
的说明ignoreWarnings
,用于忽略警告信息stats.warningsFilter
,使用ignoreWarnings
替代'none'
,当 mode 为'none'
时不使用任何优化项API
--progress
查看编译进度的参数,默认为 boolean,新增字符串的支持。如需查看详细的profile
,可以使用--progress=profile
指南
webpack-dev-server
的命令更新为webpack serve
micromatch
变更为glob-to-regexp
file-loader
、raw-loader
以及url-loader
与资源模块一同使用时,出现模块重复问题的说明,解决方案为将 asset type 设置为'javascript/auto'
插件
中文篇
configuration-types
章节的翻译工作关注我们
我们将为你带来最前沿的前端资讯。
The text was updated successfully, but these errors were encountered: