We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RHL makes the 'export default' statement omitted while using @babel/[email protected].
Keep the 'export default' statement.
{ "react-ho-loader": "^4.12.3", "@babel/core": "^7.5.0", "@babel/cli": "^7.5.0", "@babel/plugin-transform-typescript": "^7.5.1" }
Input:
export default 'foo';
Output:
(function () { var enterModule = (typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal : require('react-hot-loader')).enterModule; enterModule && enterModule(module); })(); var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) { return a; }; const _default = 'Foo'; ; // 'export default _defualt'' was Omitted <<<<<<<<<<<<<<< (function () { var reactHotLoader = (typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal : require('react-hot-loader')).default; if (!reactHotLoader) { return; } reactHotLoader.register(_default, "default", "/Users/qiqiboy/develop/tigerNewTest/babel-debug/test.tsx"); })(); ; (function () { var leaveModule = (typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal : require('react-hot-loader')).leaveModule; leaveModule && leaveModule(module); })();
babel/babel#10162 (comment)
https://github.com/gaearon/react-hot-loader/blob/master/src/babel.dev.js#L118 insertBefore returns an array of ast paths, and that plugin should call path.scope.registerDeclaration(resultOfInsertBefore[0])
Maybe I should open a PR, but I don't know how to do it.
The text was updated successfully, but these errors were encountered:
Hooray! Break the web again! PS: PR drafted
Sorry, something went wrong.
4441d6d
Merge pull request #1293 from gaearon/fix-babel-7.5
b37bf1a
fix: babel 7.5, fixes #1292
Released in 4.12.5
react-hot-loader
No branches or pull requests
Description
RHL makes the 'export default' statement omitted while using @babel/[email protected].
Expected behavior
Keep the 'export default' statement.
Environment
Reproducible Demo
Input:
Output:
The related issue
babel/babel#10162 (comment)
Maybe I should open a PR, but I don't know how to do it.
The text was updated successfully, but these errors were encountered: