@@ -16,7 +16,7 @@ const { forEach } = Array.prototype;
16
16
function debounce ( fn , time ) {
17
17
let timeout = 0 ;
18
18
19
- return function ( ) {
19
+ return function ( ) {
20
20
const self = this ;
21
21
// eslint-disable-next-line prefer-rest-params
22
22
const args = arguments ;
@@ -30,7 +30,7 @@ function debounce(fn, time) {
30
30
} ;
31
31
}
32
32
33
- function noop ( ) { }
33
+ function noop ( ) { }
34
34
35
35
function getCurrentScriptUrl ( moduleId ) {
36
36
let src = srcByModuleId [ moduleId ] ;
@@ -50,7 +50,7 @@ function getCurrentScriptUrl(moduleId) {
50
50
srcByModuleId [ moduleId ] = src ;
51
51
}
52
52
53
- return function ( fileMap ) {
53
+ return function ( fileMap ) {
54
54
if ( ! src ) {
55
55
return null ;
56
56
}
@@ -195,7 +195,7 @@ function isUrlRequest(url) {
195
195
return true ;
196
196
}
197
197
198
- module . exports = function ( moduleId , options ) {
198
+ module . exports = function ( moduleId , options ) {
199
199
if ( noDocument ) {
200
200
console . log ( 'no window.document found, will not HMR CSS' ) ;
201
201
@@ -206,7 +206,7 @@ module.exports = function(moduleId, options) {
206
206
207
207
function update ( ) {
208
208
const src = getScriptSrc ( options . filename ) ;
209
- const reloaded = reloadStyle ( src ) ;
209
+ const reloaded = src ? reloadStyle ( src ) : true ;
210
210
211
211
if ( options . locals ) {
212
212
console . log ( '[HMR] Detected local css modules. Reload all css' ) ;
0 commit comments