Skip to content

Commit 79039db

Browse files
author
MQuy
committed
Force reload if src is null
1 parent 1bd5be5 commit 79039db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/mini-css-extract-plugin/hmr/hotModuleReplacement.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { forEach } = Array.prototype;
1616
function debounce(fn, time) {
1717
let timeout = 0;
1818

19-
return function() {
19+
return function () {
2020
const self = this;
2121
// eslint-disable-next-line prefer-rest-params
2222
const args = arguments;
@@ -30,7 +30,7 @@ function debounce(fn, time) {
3030
};
3131
}
3232

33-
function noop() {}
33+
function noop() { }
3434

3535
function getCurrentScriptUrl(moduleId) {
3636
let src = srcByModuleId[moduleId];
@@ -50,7 +50,7 @@ function getCurrentScriptUrl(moduleId) {
5050
srcByModuleId[moduleId] = src;
5151
}
5252

53-
return function(fileMap) {
53+
return function (fileMap) {
5454
if (!src) {
5555
return null;
5656
}
@@ -195,7 +195,7 @@ function isUrlRequest(url) {
195195
return true;
196196
}
197197

198-
module.exports = function(moduleId, options) {
198+
module.exports = function (moduleId, options) {
199199
if (noDocument) {
200200
console.log('no window.document found, will not HMR CSS');
201201

@@ -206,7 +206,7 @@ module.exports = function(moduleId, options) {
206206

207207
function update() {
208208
const src = getScriptSrc(options.filename);
209-
const reloaded = reloadStyle(src);
209+
const reloaded = src ? reloadStyle(src) : true;
210210

211211
if (options.locals) {
212212
console.log('[HMR] Detected local css modules. Reload all css');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy