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

Types haven't been bundled by microbundle #1084

Open
XaveScor opened this issue Jul 3, 2024 · 2 comments · May be fixed by #1081
Open

Types haven't been bundled by microbundle #1084

XaveScor opened this issue Jul 3, 2024 · 2 comments · May be fixed by #1081

Comments

@XaveScor
Copy link

XaveScor commented Jul 3, 2024

Microbundle ignores *.ts files if they contain only types. Example of the file: https://github.com/XaveScor/signal-components/blob/dff96fd7151db5aae7421059836794a7880c2649/src/types.ts.

Reproduction:

git clone https://github.com/XaveScor/signal-components
git checkout tags/v0.11.0
pnpm install
pnpm build

Expected Result:

types.d.ts is included in the ./dist directory.

Actual Result:

types.d.ts does not exist. Types are broken because we have ./types imports, but the file is missing.

@sergeysova
Copy link

Have you tried?

// your types
export {}

@rschristian
Copy link
Collaborator

rschristian commented Jul 3, 2024

Looks like this was fixed upstream in ezolenko/rollup-plugin-typescript2#406, just haven't upgraded here yet.

Hopefully a postbuild cp src/type.d.ts dist/ isn't too much of a hassle for the time being.

@rschristian rschristian linked a pull request Jul 3, 2024 that will close this issue
eternal-turtles added a commit to mightylittle/transaction-log that referenced this issue Jul 18, 2024
This is a workaround for microbundle / rollup-plugin-typescript2:
* developit/microbundle#1084

Also update tsconfig.json moduleResolution to NodeNext:
* recommended setup for microbundle
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

Successfully merging a pull request may close this issue.

3 participants