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

All exports become export type when the first re-export is a type export #153

Closed
itsMapleLeaf opened this issue Oct 9, 2021 · 1 comment
Labels
Bug Something isn't working

Comments

@itsMapleLeaf
Copy link

  • Version: 1.4.7
  • Rollup Version: 2.58.0
  • Operating System and version (if applicable): Windows 10
  • Node Version (if applicable): 16.7.0
  • Does it work with tsc (if applicable): TS obviously doesn't bundle the declaration, but it does produce the correct output nonetheless

Reproduction

Given box.ts:

export type Box<T> = {
  value: T
}

export function createBox<T>(value: T): Box<T> {
  return { value }
}

Expected Behavior

In:

export type { Box } from "./box"
export { createBox } from "./box"

Out:

type Box<T> = {
    value: T;
};
declare function createBox<T>(value: T): Box<T>;
export type { Box };
export { createBox };

Actual Behavior

In:

export type { Box } from "./box"
export { createBox } from "./box"

Out:

type Box<T> = {
    value: T;
};
declare function createBox<T>(value: T): Box<T>;
export type { Box, createBox };

Repo: https://github.com/itsMapleLeaf/rollup-plugin-ts-export-type-issue

If I swap the lines in the input file, so that export { createBox } is above export type { Box }, then the output is export { Box, createBox };

itsMapleLeaf added a commit to itsMapleLeaf/gatekeeper that referenced this issue Oct 9, 2021
@wessberg wessberg added the Bug Something isn't working label Nov 17, 2021
@wessberg
Copy link
Owner

Hi there. Thanks for reporting. This has been resolved in v2.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants