When using webpack with ts-loader and ts-patch - diagnostics produced by transformer plugin is not utilised, the result - compilation is not failing even with reported diagnostics with severity ERROR. Same issue appears when using vite with rollup-plugin-typescript2 and ts-patch.
This issue appears in both ts-patch modes - Live Compiler and Persistent Patch.
When using tsc or or tspc diagnostics is utilised and failing compilation as expected.
Minimal reproduction repo: https://github.com/artem1458/ts-patch-webpack
Output from build:tsc script (failed as expected):
Custom transformer is working
src/index.ts:1:7 - error TS1: MyCustomTransformationError
1 class Foo {}
~~~
Found 1 error in src/index.ts:1
Output from build:webpack script (not failing build):
Custom transformer is working
Custom transformer is working
asset main.js 1.23 KiB [emitted] (name: main)
./src/index.ts 28 bytes [built] [code generated]
webpack 5.89.0 compiled successfully in 725 ms
Output from build:vite script (not failing build):
vite v5.0.5 building for production...
transforming (1) index.html
Custom transformer is working
✓ 3 modules transformed.
dist/index.html 0.40 kB │ gzip: 0.27 kB
dist/assets/index-0d4UnAVa.js 1.57 kB │ gzip: 0.59 kB
✓ built in 632ms
When using
webpackwithts-loaderandts-patch- diagnostics produced by transformer plugin is not utilised, the result - compilation is not failing even with reported diagnostics with severity ERROR. Same issue appears when usingvitewithrollup-plugin-typescript2andts-patch.This issue appears in both
ts-patchmodes -Live CompilerandPersistent Patch.When using
tscor ortspcdiagnostics is utilised and failing compilation as expected.Minimal reproduction repo: https://github.com/artem1458/ts-patch-webpack
Output from
build:tscscript (failed as expected):Custom transformer is working src/index.ts:1:7 - error TS1: MyCustomTransformationError 1 class Foo {} ~~~ Found 1 error in src/index.ts:1Output from
build:webpackscript (not failing build):Custom transformer is working Custom transformer is working asset main.js 1.23 KiB [emitted] (name: main) ./src/index.ts 28 bytes [built] [code generated] webpack 5.89.0 compiled successfully in 725 msOutput from
build:vitescript (not failing build):