webpack - 如何从 webpack 中获取完整的错误消息?
问题描述
我正在尝试使用 webpack 来自动添加前缀/编译我的 scss。这是我的 webpack.config.js(基本上是 bootstrap 的复制/粘贴):
const path = require('path');
module.exports = {
entry: './src/app.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.(scss)$/,
use: [
{
// Adds CSS to the DOM by injecting a `<style>` tag
loader: 'style-loader'
},
{
// Interprets `@import` and `url()` like `import/require()` and will resolve them
loader: 'css-loader'
},
{
// Loader for webpack to process CSS with PostCSS
loader: 'postcss-loader',
options: {
plugins: function () {
return [
// require('precss'),
require('autoprefixer')
];
}
}
},
{
// Loads a SASS/SCSS file and compiles it to CSS
loader: 'sass-loader'
}
]
}
]
}
};
但是,如果我有一个未定义的变量或其他一些错误,我得到的唯一细节wp -w
是
0:0 错误模块构建失败(来自 ./node_modules/sass-loader/lib/loader.js):
这并没有告诉我任何事情。我想知道错误的文件和行号、数量和类型。
编辑:我看了看,wp --help
我尝试过--debug
,--log-level debug
但都没有让我到达我想要的地方。
解决方案
推荐阅读
- jquery - 加载后更改 Authorize.net AcceptUI.js “data-paymentOptions”
- c# - 如何正确关闭阅读器?
- excel - 根据日期和时间导入电子邮件数据
- java - 如何从 textview 结果中获取值到 Alertdialog
- python-3.x - FeatureTools:如何在数据集之间的关系是多对多的情况下使用特征工具?
- sql - 数据在那里,但计数返回 0
- python - 使用 strptime() 错误的日期时间类型转换
- reactjs - 如何使用 React js 复制 typeform
- symfony - 获取所有项目并在 Symfony 中对关系中使用的项目进行排序
- python - 如何优化 kwargs.values() 中的“字符串”: