reactjs - Webpack 安全问题 - css-loader
问题描述
所以我有一个简单的反应应用程序的 suuuuper 基本 webpack 设置。我一直在使用 css-loader 为 webpack 翻译我的 CSS。但是我收到了一个安全警告……似乎没有发布的解决方案。
这是警告:
│ Critical │ Command Injection │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ macaddress │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ No patch available │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ css-loader [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ css-loader > cssnano > postcss-filter-plugins > uniqid > │
│ │ macaddress │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/654
如您所见,问题不在于 webpack 本身,而在于这个 macaddress 包。我不知道该怎么办。它说它是“关键的”....有解决办法吗?我可以使用css-loader以外的东西吗?
这是我完整的 webpack.config.js 文件:
const HtmlWebPackPlugin = require('html-webpack-plugin');
module.exports={
module: {
rules: [
{
test: /\.js$/,
exclude: [
"/node_modules/",
"src/tests/"
],
use: {
loader: "babel-loader"
}
},
{
test: /\.scss$/,
use: [
{
loader: "style-loader" // creates style nodes for JS strings
},
{
loader: "css-loader" // translates CSS into CommonJS
},
{
loader: "sass-loader" // compiles Sass to CSS
}
]
},
{
test: /\.html$/,
use: [
{
loader: "html-loader"
}
]
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: "./public/index.html", // where to read
filename: "./index.html" // where to put code
})
]
}
我只想要一个没有安全问题的工作 webpack 设置。提前致谢。
解决方案
正如@David Tyron 所发布的,在 GitHub 上打开了一个问题,发布2.0.3
应该可以解决它。尝试更新。
推荐阅读
- ms-access - 有没有办法在表或查询的设计视图中搜索字段名称?
- java - Twitter4j如何从特定时间获取推文
- typescript - 文档类型上不存在属性“密码”
- flutter - 如何从 TextField 中删除内容填充?
- javascript - 如何在 jQuery datepicker 中获取所选月份的最后一天?
- pandas - 如何让 Pandas 将零排序到索引的开头?
- c# - 如何在 .net 核心中哈希密码等于 .net 框架
- android - 如何在没有 ActionBar 的片段中实现 SeachView
- javascript - 为什么 Vue.js 使用单字标签
,这违反了自己的风格指南? - algorithm - 如何判断两个序列是否因排列不同?