Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit cc82df3

Browse files
authored
refactor(HMR): rename module to path in context object (#787)
* refactor: rename module to path parameter * style: add a missing whitespace
1 parent 5950e79 commit cc82df3

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

‎bundle-config-loader.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ module.exports = function (source) {
1212
hmrUpdate();
1313
};
1414
15-
global.hmrRefresh = function({ type, module } = {}) {
15+
global.hmrRefresh = function({ type, path } = {}) {
1616
if (global.__initialHmrUpdate) {
1717
return;
1818
}
1919
2020
setTimeout(() => {
21-
global.__hmrSyncBackup({ type, module });
21+
global.__hmrSyncBackup({ type, path });
2222
});
2323
};
2424

‎hot-loader-helper.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
module.exports.reload = function ({ type, module }) {
1+
module.exports.reload = function ({ type, path }) {
22
return `
33
if (module.hot) {
44
module.hot.accept();
55
module.hot.dispose(() => {
6-
global.hmrRefresh({ type: '${type}', module: '${module}' });
6+
global.hmrRefresh({ type: '${type}', path: '${path}' });
77
})
88
}
99
`};

‎markup-hot-loader.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ const { reload } = require("./hot-loader-helper");
33
module.exports = function (source) {
44
const typeMarkup = "markup";
55
const modulePath = this.resourcePath.replace(this.rootContext, ".");
6-
return `${source};${reload({ type: typeMarkup, module: modulePath })}`;
6+
return `${source};${reload({ type: typeMarkup, path: modulePath })}`;
77
};

‎script-hot-loader.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ const { reload } = require("./hot-loader-helper");
33
module.exports = function (source) {
44
const typeScript = "script";
55
const modulePath = this.resourcePath.replace(this.rootContext, ".");
6-
return `${source};${reload({ type: typeScript, module: modulePath })}`;
6+
return `${source};${reload({ type: typeScript, path: modulePath })}`;
77
};

‎style-hot-loader.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ const { reload } = require("./hot-loader-helper");
33
module.exports = function (source) {
44
const typeStyle = "style";
55
const modulePath = this.resourcePath.replace(this.rootContext, ".");
6-
return `${source};${reload({ type: typeStyle, module: modulePath })}`;
6+
return `${source};${reload({ type: typeStyle, path: modulePath })}`;
77
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /