File tree Expand file tree Collapse file tree 2 files changed +16
-31
lines changed Expand file tree Collapse file tree 2 files changed +16
-31
lines changed Original file line number Diff line number Diff line change @@ -132,39 +132,23 @@ ${hmrCode}
132132 const hmrCode = this . hot
133133 ? `
134134if (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, '']];
154146 }
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);
163149 }
164-
165- update(newContent);
166- }
167- );
150+ )
151+ }
168152
169153 module.hot.dispose(function() {
170154 update();
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const ENABLE_SOURCE_MAP =
66 : false ;
77
88module . exports = {
9+ devtool : ENABLE_SOURCE_MAP ? 'source-map' : false ,
910 mode : 'development' ,
1011 output : {
1112 publicPath : '/dist/' ,
You can’t perform that action at this time.
0 commit comments