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

Commit 73779bb

Browse files
authored
Merge pull request #5 from tanhongit/develop
optimize webpack config
2 parents 5168a1e + 97713c0 commit 73779bb

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Laravel Generator UI is a collection of HTML, CSS, and JS files that implement a
44

55
[![Latest Version](https://img.shields.io/github/release/tanhongit/laravel-generator-ui.svg?style=flat-square)](https://github.com/tanhongit/laravel-generator-ui/releases)
66

7+
This package using [Material Dashboard 2](https://demos.creative-tim.com/material-dashboard/docs/2.1/getting-started/introduction.html) template. Any help is welcome.
8+
And you can download this package and customize it for your own needs.
9+
710
## License
811

912
The Apache License 2.0. Please see [License File](LICENSE) for more information.

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)