Optimize webpack.config.js file

This commit is contained in:
Paul Laros
2023-06-08 22:53:05 +02:00
parent a799cd5630
commit 8eddf462d3
+5 -9
View File
@@ -51,6 +51,7 @@ module.exports = {
] ]
}), }),
// Copy dist folder to static // Copy dist folder to static
...(process.env.NODE_ENV === "production")? [
new FileManagerPlugin({ new FileManagerPlugin({
events: { events: {
onEnd: { onEnd: {
@@ -58,8 +59,9 @@ module.exports = {
{ source: "./dist/", destination: "./static" } { source: "./dist/", destination: "./static" }
] ]
} }
} },
}), })
] : [],
], ],
module: { module: {
rules: [ rules: [
@@ -81,12 +83,7 @@ module.exports = {
MiniCssExtractPlugin.loader, MiniCssExtractPlugin.loader,
"css-loader", "css-loader",
"postcss-loader", "postcss-loader",
{ "sass-loader"
loader: "sass-loader",
options: {
implementation: require.resolve("sass"),
}
}
] ]
}, },
// Load fonts // Load fonts
@@ -118,7 +115,6 @@ module.exports = {
static: { static: {
directory: Path.join(__dirname, "static") directory: Path.join(__dirname, "static")
}, },
compress: true,
port: 8080, port: 8080,
open: true open: true
} }