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
Does this work with @rollup/plugin-typescript ? #13
Comments
Up on further investigation, I got it to work using (in rollup config): import typescript from '@rollup/plugin-typescript'
...
plugins: [typescript({
transformers: {
before: [ { type: 'program', factory: (program) => di({program}).before[0] } ],
after: [ { type: 'program', factory: (program) => di({program}).after[0] } ]
}
})] This generates the correct bundle like: container.registerSingleton(undefined, { identifier: 'HackerNewsService', implementation: HackerNewsService }); But the javascript code for all of my classes (like |
Hi there, The DI-Compiler must be passed a TypeScript Program since it depends on a type checker. That's why you need to pass the program on to it. Your example doesn't work, though, as you pass the DI Custom Transformer twice, one for the If you experience issues with interoperability between In the meantime, you can use DI-Compiler with |
Hi, I've wrote a workaround helper for @rollup/plugin-typescript to easly apply this transformer. Here is the npm link Usage:
|
Asking this since the
@rollup/plugin-typescript
plugin supportstransformers
option for typescript.I tried but getting this error:
The text was updated successfully, but these errors were encountered: