Skip to content

Commit 5bd9533

Browse files
committed
added workaround for creating js-files for extracted css.
1 parent d33929d commit 5bd9533

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"sweetalert2": "^7.26.11",
5454
"sweetalert2-react-content": "^1.0.1",
5555
"webpack": "^4.16.5",
56-
"webpack-cli": "^3.1.0"
56+
"webpack-cli": "^3.1.0",
57+
"webpack-fix-style-only-entries": "0.0.2"
5758
}
5859
}

webpack.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
const path = require('path');
22
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
33

4+
/* TODO remove when webpack fixed this error:
5+
* Links to this error:
6+
* https://github.com/webpack/webpack/issues/7300
7+
* https://github.com/JeffreyWay/laravel-mix/pull/1495
8+
* https://github.com/webpack-contrib/mini-css-extract-plugin/issues/151
9+
* and more...
10+
*
11+
* This will be, as far as i know, fixed in webpack 5, it is currently in development
12+
*/
13+
const FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
14+
415
module.exports = {
516
entry: {
617
// js: './ui/index.js',
@@ -86,6 +97,7 @@ module.exports = {
8697
hints: false
8798
},
8899
plugins: [
100+
new FixStyleOnlyEntriesPlugin(),
89101
new MiniCssExtractPlugin({
90102
filename: "bundle.css"
91103
})

0 commit comments

Comments
 (0)