From 680863702e67d69dc4ec8d6a48b0e1402164cc97 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 5 Jan 2021 14:51:19 -0500 Subject: [PATCH] fix: removes prod devtool --- src/bin/build.ts | 13 +++++++++---- src/webpack/getProdConfig.ts | 1 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bin/build.ts b/src/bin/build.ts index c14834ebda..36811ff74d 100755 --- a/src/bin/build.ts +++ b/src/bin/build.ts @@ -22,10 +22,15 @@ export const build = (): void => { webpack(webpackProdConfig, (err, stats) => { // Stats Object if (err || stats.hasErrors()) { // Handle errors here - console.error(stats.toString({ - chunks: false, - colors: true, - })); + + if (stats) { + console.error(stats.toString({ + chunks: false, + colors: true, + })); + } else { + console.error(err.message); + } } }); } catch (err) { diff --git a/src/webpack/getProdConfig.ts b/src/webpack/getProdConfig.ts index 8ad3d85910..de0abffc8c 100644 --- a/src/webpack/getProdConfig.ts +++ b/src/webpack/getProdConfig.ts @@ -19,7 +19,6 @@ export default (payloadConfig: Config): Configuration => { chunkFilename: '[name].[chunkhash].js', }, mode: 'production', - devtool: 'none', stats: 'errors-only', optimization: { minimizer: [new TerserJSPlugin({}), new CssMinimizerPlugin()],