Type-only TypeScript files break development and Webpack plugin #1557
Replies: 3 comments 1 reply
-
I tried this out locally and I didn't get any errors, but I might have missed something. If you have your code on Github that would help. |
Beta Was this translation helpful? Give feedback.
-
I have made a reproduction for the problem. It requires a type-only .ts file and a re-export. See my reproduction repository. It is made from a Snowpack template with a single commit on top that only adds the foo directory. In it there’s a type-only file a.ts, and a file with a function b.ts. Both are re-exported in index.ts. The issue happens after a build. You can run Let me know if I can provide any more detail! @melissamcewen |
Beta Was this translation helpful? Give feedback.
-
This is present in the latest 3.0.11. |
Beta Was this translation helpful? Give feedback.
-
A type-only file is not emitted. This prevents the app from loading in the development mode and crashes Webpack plugin at build time.
Type-only TS files are not a corner case, it is common to define a data model in types in a stand-alone file for organization, for more convenient reuse.
Related, possibly a duplicate, depending on perspective: #1509.
@melissamcewen
Beta Was this translation helpful? Give feedback.
All reactions