Skip to content

Commit 282c8be

Browse files
committed
enabled sourceMaps
1 parent 978b759 commit 282c8be

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- Tell the browser to be responsive to screen width -->
99
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
1010

11-
<link rel="stylesheet" type="text/css" href="./bundle.css">
11+
<link rel="stylesheet" type="text/css" href="./style.css">
1212
</head>
1313
<body class="hold-transition skin-blue sidebar-mini">
1414
<div id="app"></div>

webpack.config.js

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

4-
/* TODO remove when webpack fixed this error:
4+
/**
5+
* TODO remove when webpack fixed this error:
56
* Links to this error:
67
* https://github.com/webpack/webpack/issues/7300
78
* https://github.com/JeffreyWay/laravel-mix/pull/1495
89
* https://github.com/webpack-contrib/mini-css-extract-plugin/issues/151
910
* and more...
1011
*
11-
* This will be, as far as i know, fixed in webpack 5, it is currently in development
12+
* As far as i know, this will be fixed in webpack 5
13+
* ~knoxfighter
1214
*/
1315
const FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
16+
const isProduction = process.env.NODE_ENV == 'production';
1417

1518
module.exports = {
1619
entry: {
@@ -28,6 +31,7 @@ module.exports = {
2831
},
2932
extensions: ['.js', '.json', '.jsx']
3033
},
34+
devtool: (isProduction) ? "none" : "source-map",
3135
module: {
3236
rules: [
3337
{
@@ -41,7 +45,12 @@ module.exports = {
4145
test: /\.scss$/,
4246
use: [
4347
MiniCssExtractPlugin.loader,
44-
"css-loader",
48+
{
49+
loader: "css-loader",
50+
options: {
51+
"sourceMap": !isProduction,
52+
}
53+
},
4554
"resolve-url-loader",
4655
"sass-loader?sourceMap"
4756
]

0 commit comments

Comments
 (0)