awesome-typescript-loader
awesome-typescript-loader copied to clipboard
Error checker doesn't emit errors on a simple (no change) rebuild
Hello @s-panferov!,
Noticed a strange issue while building my application today. When I run the very first build, the error checker reports all errors & fails the build. However, if I make no changes & re-run my build process, it works. If I open the files, I can still see the errors but they are not reported again unless I make a change in one of the files. Please let me know what is wrong. Configuration: VSCode: 1.19.1 Webpack 3.10.0 ATL: 3.4.1
const commonPlugins = [
new webpack.LoaderOptionsPlugin({
options: {
sassLoader: {
sourceMap: true,
includePaths: ['resources/scss'],
context: __dirname
}
}
}),
new webpack.IgnorePlugin(/^./locale$/, /moment$/),
new webpack.WatchIgnorePlugin([
/static/,
/.chunk./
]),
new webpack.NoEmitOnErrorsPlugin(),
new HardSourceWebpackPlugin()
]
module: {
rules: [{
test: /.ts$/,
use: [
{ loader: 'cache-loader' },
{
loader: 'awesome-typescript-loader',
options: {
configFileName: ./tsconfig${dev ? '.dev' : ''}.json
,
useCache: true,
forceIsolatedModules: true
}
},
'angular2-template-loader',
'angular2-router-loader'
]
}]
}
I have the same issue. This happens when using this plugin in conjunction with hard-source-webpack-plugin
.
If I remove hard-source-webpack-plugin
the errors are always reported.
As a workaround you can use fork-ts-checker-webpack-plugin
instead of the CheckerPlugin
from awesome-typescript-loader
, while still using the loader from awesome-typescript-loader
.
It happens for me without hard-source as well. Only way I can make it work is if I delete the atl cache folder and rebuild. So it’s an atl cache issue. fork-ts works asynchronous and hence the errors it reports doesn’t stop/break the build. The developers could easily miss the issues and keep working.. :/
Async can be turned off in fork-ts-checker-webpack-plugin
. See options.