-
Notifications
You must be signed in to change notification settings - Fork 5
Description
First off, really impressive work on the compiler. The compilation speed is noticeably faster and the Vite integration feels great to work with.
I've been trying to use @oxc-angular/vite to build and publish an Angular component library via tsdown. I'm aware this is not the intended use case since the plugin is designed for Vite, but as it exposes a rollup-compatible plugin interface I hoped it would carry over to rolldown-based library builds too, and the JS output actually works perfectly: ɵcmp is correctly emitted.
However the .d.ts files are generated by plain tsc, which has no knowledge of Angular's ivy compiler, so consumers get:
Component imports must be standalone components, directives, pipes, or NgModules. (-992012)
because ɵɵComponentDeclaration<...> is missing from the type declarations entirely.
I put together a minimal repro: schplitt/oxc-angular-lib-dts-reproduction
npm install && npm run build shows the mismatch immediately. dist/index.js has ɵcmp, dist/index.d.ts does not.
The fix would require either:
- a post-processing step that emits ivy
.d.tsshims alongside the bundled output - or a
compilationMode: 'partial'option for library builds (similar to whatng-packagrdoes viangtsc)
Is library build support in scope, or is this intentionally out of bounds for this project?