Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Commit 604ab78

Browse files
committed
optimize webpack config
1 parent 5168a1e commit 604ab78

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

webpack.config.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@ const config = {
77
entry: {
88
main: [
99
"./src/style/css/material-dashboard.css",
10-
1110
"./src/js/material-dashboard.js",
1211
],
1312
editor: {
1413
import: [
1514
// CSS
1615
'./src/assets/css/style.css',
17-
1816
// SCSS
1917
'./src/assets/scss/style.scss',
20-
2118
// JS
2219
'./src/assets/js/script.js',
2320
]
@@ -37,12 +34,8 @@ const config = {
3734
publicPath: "",
3835
},
3936
},
40-
{
41-
loader: "css-loader",
42-
},
43-
{
44-
loader: "postcss-loader",
45-
},
37+
"css-loader",
38+
"postcss-loader",
4639
],
4740
},
4841
{
@@ -82,9 +75,9 @@ const config = {
8275
ecma: 6,
8376
},
8477
}),
85-
new CssMinimizerPlugin()],
78+
new CssMinimizerPlugin(),
79+
],
8680
},
87-
8881
plugins: [
8982
new StylelintPlugin({
9083
files: ["./**/*.{scss,sass}"],
@@ -93,10 +86,8 @@ const config = {
9386
new MiniCssExtractPlugin(),
9487
],
9588
};
96-
module.exports = (env, argv) => {
97-
argv.mode === "development"
98-
? (config.devtool = "eval-cheap-module-source-map")
99-
: (config.devtool = "source-map");
10089

90+
module.exports = (env, { mode }) => {
91+
config.devtool = mode === "development" ? "eval-cheap-module-source-map" : "source-map";
10192
return config;
10293
};

0 commit comments

Comments
 (0)