Conversation
packages/vite/rollup.dts.config.ts
Outdated
| case 'TransformResult$1': return 'esbuild_TransformResult' | ||
| case 'TransformResult$2': return 'rollup.TransformResult' |
There was a problem hiding this comment.
I am a bit concerned that these two might suddenly be swapped in one day. For example, if rollup changes its chunking mechanism or renaming algorithm, or our code changes somehow changes the import order.
There was a problem hiding this comment.
Hmm true. I guess it would be safer if they aren't using namespaces at all, so the worst case is the confusing names.
Maybe I'll need to find another way to handle this, checking import-by-import perhaps then swapping it out 🤔
There was a problem hiding this comment.
Could this be tested somehow to detect if the order was changed so you can keep the current code?
There was a problem hiding this comment.
Running a typecheck after building the types could work, but we'd need a cover all the possible JS APIs. I'm currently working on a more strict approach that maybe helps with this.
There was a problem hiding this comment.
The last commit should be stricter now. Unfortunately it's a little more code.
Description
Following up from #14571
The generated types file is improved a little.
Plugin$1are renamed to something better (previously happen in api-extractor too). The type names can sometimes show up in TypeScript messages which is confusing.Additional context
Also wonder if we should export the esbuild type, but I left it out for now.
What is the purpose of this pull request?