Skip to content

Commit 3bfc052

Browse files
committed
chore(webpack): mimic FriendlyErrorsWebpackPlugin config from nuxt
1 parent 1ae3710 commit 3bfc052

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/webpack.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,20 @@ export default function webpackNetlifyCmsConfig(
103103
config.plugins.push(
104104
new webpack.HotModuleReplacementPlugin(),
105105
new webpack.NoEmitOnErrorsPlugin(),
106-
// Add friendly error plugin
107-
new FriendlyErrorsWebpackPlugin(),
108106
// https://webpack.js.org/plugins/named-modules-plugin
109107
new webpack.NamedModulesPlugin()
110108
);
109+
110+
// Add friendly error plugin
111+
if (!nuxtOptions.build.quiet && nuxtOptions.build.friendlyErrors) {
112+
config.plugins.push(
113+
new FriendlyErrorsWebpackPlugin({
114+
clearConsole: false,
115+
reporter: "consola",
116+
logLevel: "WARNING"
117+
})
118+
);
119+
}
111120
} else {
112121
// --------------------------------------
113122
// Production specific config

0 commit comments

Comments
 (0)