Commit f026429 1 parent f4cf0d2 commit f026429 Copy full SHA for f026429
File tree 2 files changed +16
-31
lines changed
2 files changed +16
-31
lines changed Original file line number Diff line number Diff line change @@ -132,39 +132,23 @@ ${hmrCode}
132
132
const hmrCode = this . hot
133
133
? `
134
134
if (module.hot) {
135
- module.hot.accept(
136
- ${ loaderUtils . stringifyRequest ( this , `!!${ request } ` ) } ,
137
- function() {
138
- var newContent = require(${ loaderUtils . stringifyRequest (
139
- this ,
140
- `!!${ request } `
141
- ) } );
142
-
143
- if (typeof newContent === 'string') {
144
- newContent = [[module.id, newContent, '']];
145
- }
146
-
147
- var locals = (function(a, b) {
148
- var key,
149
- idx = 0;
150
-
151
- for (key in a) {
152
- if(!b || a[key] !== b[key]) return false;
153
- idx++;
135
+ if (!content.locals) {
136
+ module.hot.accept(
137
+ ${ loaderUtils . stringifyRequest ( this , `!!${ request } ` ) } ,
138
+ function () {
139
+ var newContent = require(${ loaderUtils . stringifyRequest (
140
+ this ,
141
+ `!!${ request } `
142
+ ) } );
143
+
144
+ if (typeof newContent === 'string') {
145
+ newContent = [[module.id, newContent, '']];
154
146
}
155
-
156
- for (key in b) idx--;
157
-
158
- return idx === 0;
159
- }(content.locals, newContent.locals));
160
-
161
- if (!locals) {
162
- throw new Error('Aborting CSS HMR due to changed css-modules locals.');
147
+
148
+ update(newContent);
163
149
}
164
-
165
- update(newContent);
166
- }
167
- );
150
+ )
151
+ }
168
152
169
153
module.hot.dispose(function() {
170
154
update();
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const ENABLE_SOURCE_MAP =
6
6
: false ;
7
7
8
8
module . exports = {
9
+ devtool : ENABLE_SOURCE_MAP ? 'source-map' : false ,
9
10
mode : 'development' ,
10
11
output : {
11
12
publicPath : '/dist/' ,
You can’t perform that action at this time.
0 commit comments