Skip to content
New issue

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

[Bug] statementMerger uses 1st export default statement as default #148

Open
ops1ops opened this issue Sep 11, 2021 · 0 comments
Open

[Bug] statementMerger uses 1st export default statement as default #148

ops1ops opened this issue Sep 11, 2021 · 0 comments

Comments

@ops1ops
Copy link

ops1ops commented Sep 11, 2021

Bug

Hey, recently ive noticed that after build plugin sets 1st default export in .d.ts to default even when i export as default not this statement. For example i have Header.tsx

import useHeaderLogic from './useHeaderLogic '; // useHeaderLogic has default export
...
const Header = () => {
  ...
  useHeaderLogic();
  ...
};

export default Header;

and after build Header-[hash].d.ts looks like this:

declare const useHeaderLogic
...
declare const Header
...
export { useHeaderLogic as default };

but expected Header to be default

and for example if i dont use default export in useHeaderLogic, Header becomes default in .d.ts, i think plugin just takes 1st default export (including imported modules)

Plugin version: 1.3.14
Typescript version: 4.0.2

upd:
probably this line of code creates export statements, i dont see any settings or something what depends on me, so i consider this is a bug

@ops1ops ops1ops changed the title export as default uses 1st declare [Bug] statementMerger uses 1st default statement as default Sep 13, 2021
@ops1ops ops1ops changed the title [Bug] statementMerger uses 1st default statement as default [Bug] statementMerger uses 1st export default statement as default Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant