Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Replace backslashes by slashes in require.resolve calls.
Browse files Browse the repository at this point in the history
Because windows...
  • Loading branch information
geowarin committed Mar 24, 2016
1 parent 01688f9 commit 404573d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/transforms/higher-order-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function higherOrderVisitor (traverse, node, path, state) {
utils.catchup(component.arg.range[0], state);
utils.append('__electronHot__.register(', state);
utils.catchup(component.arg.range[1], state);
utils.append(', require.resolve(' + component.path + '))', state);
utils.append(', require.resolve(' + component.path.replace(/\\/g, '/') + '))', state);
});

return false;
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/react-jsx-visitors.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function visitReactTag (traverse, object, path, state) {
utils.catchup(nameObject.range[1], state);
// GWA: monkey patch
if (state.g.opts.doNotInstrument !== true && requirePath) {
utils.append(", require.resolve('" + requirePath + "'))", state);
utils.append(", require.resolve('" + requirePath.replace(/\\/g, '/') + "'))", state);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/watchJsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function watchJsx (directories, options) {
' and that require("electron-hot-loader").install() has been called before any JSX is required.');
return;
}
delete require.cache[require.resolve(f)];
delete require.cache[f];
var newComponent = require(f);
cachedProxy.update(newComponent);
deepForceUpdate(rootInstance);
Expand Down

0 comments on commit 404573d

Please sign in to comment.