Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 45f5f6d

Browse files
committed
fix: check for syntactic errors when running typescript compilation in ts projects
Currently `ts-loader` is started in `transpileOnly` mode and webpack plugin (`ForkTsCheckerWebpackPlugin`) runs TypeScript type checker on a separate process in order to report for compilation errors. By default the plugin only checks for semantic errors and adds them to `compilation.errors`. On the other side, `WatchStateLoggerPlugin` relies on `compilation.errors` array, process them on `afterEmit` hook and reports them to NativeScript CLI. However, `ts-loader` used in `transpileOnly` mode still reports syntactic errors but adds them to `compilation.warnings`. This is a problem, as `WatchStateLoggerPlugin` doesn't process `compilation.warnings` and this way the errors are not reported to the CLI. Setting `checkSyntacticErrors: true` will ensure that `ForkTsCheckerWebpackPlugin` checks for both syntactic and semantic errors. This way both syntactic and semantic errors will be added to `compilation.errors` array and reported to the CLI.
1 parent f4a2c83 commit 45f5f6d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

templates/webpack.typescript.js

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ module.exports = env => {
253253
tsconfig: tsConfigPath,
254254
async: false,
255255
useTypescriptIncrementalApi: true,
256+
checkSyntacticErrors: true,
256257
memoryLimit: 4096
257258
})
258259
],

0 commit comments

Comments
 (0)