mirror of
https://github.com/adminkit/adminkit.git
synced 2026-03-31 11:47:45 +01:00
Optimize webpack.config.js file
This commit is contained in:
+12
-16
@@ -51,15 +51,17 @@ module.exports = {
|
|||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
// Copy dist folder to static
|
// Copy dist folder to static
|
||||||
new FileManagerPlugin({
|
...(process.env.NODE_ENV === "production")? [
|
||||||
events: {
|
new FileManagerPlugin({
|
||||||
onEnd: {
|
events: {
|
||||||
copy: [
|
onEnd: {
|
||||||
{ source: "./dist/", destination: "./static" }
|
copy: [
|
||||||
]
|
{ 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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user