首先,webpack编译的答案带有警告,但警告消息为空,不起作用。
当使用pwa模式时,我得到了以下关于我的类星体1v项目的增量构建。
警告编译有1个警告
警告
我试着像一样将'verbose'
和{ warnings: true }
添加到webpack配置中
{
build: {
extendWebpack(cfg) {
cfg.stats = 'verbose';
// or
cfg.stats = { warnings: true };
}
}
}
预期输出quasar inspect -p stats
,但没有变化。
如何调查此警告?
ps警告似乎也阻止了热重新加载的工作(我必须手动刷新每个更改(
插件挂钩就是答案。
就我而言,警告是:
InjectManifest已被调用`多次,可能是由于在--watch模式下运行webpack。第一次调用后生成的预缓存清单可能不准确!请参阅https://github.com/GoogleChrome/workbox/issues/1790了解更多信息。
作为一个字符串没有对象,所以它没有正确显示。我是通过找到的
my-plugin.js
class MyPlugin {
apply(compiler) {
compiler.hooks.done.tap(
"MyPlugin",
({ compilation } => {
console.log("done");
console.log(`warnings ${compilation.warnings.length}`);
compilation.warnings.forEach((warning, index) => {
console.log(`warning ${typeof warning}`);
console.log(warning);
});
})
);
}
}
quasar.conf.js
{
build: {
extendWebpack(cfg) {
cfg.plugins = cfg.plugins || [];
cfg.plugins.push(new MyPlugin());
}
}
}
导致
警告编译有1个警告
警告
done
warnings 1
警告字符串
InjectManifest已被调用`多次,可能是由于在--watch模式下运行webpack所致。第一次调用后生成的预缓存清单可能不准确!请参阅https://github.com/GoogleChrome/workbox/issues/1790了解更多信息。