From 8eddf462d36dabf645702cbd308e4a8e5349c5c7 Mon Sep 17 00:00:00 2001 From: Paul Laros Date: Thu, 8 Jun 2023 22:53:05 +0200 Subject: [PATCH] Optimize webpack.config.js file --- webpack.config.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 17c19f3..d14c9c4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -51,15 +51,17 @@ module.exports = { ] }), // Copy dist folder to static - new FileManagerPlugin({ - events: { - onEnd: { - copy: [ - { source: "./dist/", destination: "./static" } - ] - } - } - }), + ...(process.env.NODE_ENV === "production")? [ + new FileManagerPlugin({ + events: { + onEnd: { + copy: [ + { source: "./dist/", destination: "./static" } + ] + } + }, + }) + ] : [], ], module: { rules: [ @@ -81,12 +83,7 @@ module.exports = { MiniCssExtractPlugin.loader, "css-loader", "postcss-loader", - { - loader: "sass-loader", - options: { - implementation: require.resolve("sass"), - } - } + "sass-loader" ] }, // Load fonts @@ -118,7 +115,6 @@ module.exports = { static: { directory: Path.join(__dirname, "static") }, - compress: true, port: 8080, open: true }