Running rollup in watch mode with typescript plugin if the typescript code is invalid the watcher breaks and exits with exit code 1. This make it impossible to re-build the code on code changes - you need to re-start the command every time.
(noEmitOnError ts compiler option doesn't help here)
https://github.com/karolis-sh/issue-rollup-typescript-1 (has a readme file)
Watch mode should work just like using js files.
Watch mode exits with exit code 1.
Currently you have noEmitOnError: true in your project setup. Have you tried noEmitOnError: false to let typescript emit stuff even on errors instead of failing?
@danimoh yes, it has no effect.
As stated on plugin readme, it ignores the noEmitOnError property defined in tsconfig.json.
The only way to override it is adding noEmitOnError: false at plugin setup. See example below:
/* rollup.config.js */
[...]
plugins: [
typescript({
noEmitOnError: false
})
]
[...]
@Tylerian yeah, you're right typescript({ noEmitOnError: false }) makes the plugin usable in development mode.
Though I feel this should be enabled by default in watch mode, otherwise it's rather unintuitive.
Anyway, thanks for the help - it was getting pretty annoying to always restart my watchers.
Though I feel this should be enabled by default in watch mode, otherwise it's rather unintuitive.
Yeah, I agree with that too. Perhaps you can open a new Feature Request so the maintainers can discuss this with you and hopefully agree to add it to the plugin.
Most helpful comment
@Tylerian yeah, you're right
typescript({ noEmitOnError: false })makes the plugin usable in development mode.Though I feel this should be enabled by default in watch mode, otherwise it's rather unintuitive.
Anyway, thanks for the help - it was getting pretty annoying to always restart my watchers.