@@ -21,8 +21,8 @@ const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
2121const getClientEnvironment = require ( './env' ) ;
2222const paths = require ( './paths' ) ;
2323
24- const HardSourceWebpackPlugin = require ( 'hard-source-webpack-plugin' ) ;
25- const TsCheckerWebpackPlugin = require ( 'ts-checker-webpack-plugin' ) ;
24+ // const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
25+ const ForkTsCheckerWebpackPlugin = require ( 'fork- ts-checker-webpack-plugin' ) ;
2626const TsconfigPathsPlugin = require ( 'tsconfig-paths-webpack-plugin' ) ;
2727
2828// Webpack uses `publicPath` to determine where the app is being served from.
@@ -267,24 +267,18 @@ module.exports = {
267267 } ,
268268 ] ,
269269 } ,
270-
271270 // Compile .tsx
272271 {
273- test : / \. ( t s | t s x ) $ / ,
274- include : paths . appSrc ,
275- use : [
276- {
277- loader : require . resolve ( 'awesome-typescript-loader' ) ,
278- options : {
279- // disable type checker - we will use it in fork plugin
280- useCache : true ,
281- reportFiles : [
282- paths . appSrc + '/**/*.{ts,tsx}'
283- ] ,
284- forceIsolatedModules : true
285- } ,
286- } ,
287- ] ,
272+ test : / \. t s x ? $ / ,
273+ include : paths . srcPaths ,
274+ exclude : [ / [ / \\ \\ ] n o d e _ m o d u l e s [ / \\ \\ ] / ] ,
275+ use : [ {
276+ loader : require . resolve ( 'ts-loader' ) ,
277+ options : {
278+ // disable type checker - we will use it in fork plugin
279+ transpileOnly : true
280+ }
281+ } ]
288282 } ,
289283 // "postcss" loader applies autoprefixer to our CSS.
290284 // "css" loader resolves paths in CSS and adds assets as dependencies.
@@ -393,11 +387,11 @@ module.exports = {
393387 // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
394388 // You can remove this if you don't use Moment.js:
395389 new webpack . IgnorePlugin ( / ^ \. \/ l o c a l e $ / , / m o m e n t $ / ) ,
396- new TsCheckerWebpackPlugin ( {
390+ new ForkTsCheckerWebpackPlugin ( {
397391 tsconfig : paths . appTsConfig ,
398392 tslint : paths . appTsLint ,
399393 } ) ,
400- new HardSourceWebpackPlugin ( )
394+ // new HardSourceWebpackPlugin()
401395 ] ,
402396 // Some libraries import Node modules but don't use them in the browser.
403397 // Tell Webpack to provide empty mocks for them so importing them works.
0 commit comments