Closed agilgur5 closed 2 years ago
sh*t, I was reading https://github.com/ezolenko/rollup-plugin-typescript2/issues/103#issuecomment-549948943 and this seems to break watch mode for some reason.... back to the drawing board again....
Oh... well apparently Rollup needs some other properties that it attaches to the error:
{
id: '/project-dir/src/difference.ts',
hook: 'transform',
code: 'PLUGIN_ERROR',
plugin: 'rpt2',
watchFiles: [
'/project-dir/src/index.ts',
'/project-dir/tsconfig.json',
'/project-dir/src/types.ts',
'/project-dir/src/difference.ts'
]
}
}
So need to spread those in. And spreading them in makes watch mode work again, thankfully
This has been fixed upstream in Rollup in https://github.com/rollup/rollup/pull/4749 and released in Rollup v3.7.5
Summary
Adds a workaround for a Rollup bug that causes duplicate error messages
Details
per https://github.com/ezolenko/rollup-plugin-typescript2/issues/103#issuecomment-1172820658 and my investigation in #372, it seems like Rollup has a bug where it duplicates some error message
this fix adds a workaround for this upstream Rollup bug
Review Notes
This is gonna merge conflict pretty hard with #345 's current code (as these both add the
buildEnd
hook), but I made them both compatible with each other. Will just have to update one or the other when one is mergedFuture Work
I'll make a PR to Rollup proper and link it here as well