laravel-mix-react-typescript-extension icon indicating copy to clipboard operation
laravel-mix-react-typescript-extension copied to clipboard

Integrated "fork-ts-checker-webpack-plugin"

Open zimudec opened this issue 5 years ago • 2 comments

Integrated "fork-ts-checker-webpack-plugin" to analyze typescript errors automatically in the compilation process, without the need to do it manually with tsc (Requires tsconfig.json file in the folder from where it is compiled)

zimudec avatar Jul 29 '20 20:07 zimudec

Thanks @zimudec! That's a great idea.

I am so out of touch with repo, I don't wanna change anything at a whim. I'll take a look once I got some free time and merge it in with a new version.

raicem avatar Aug 21 '20 07:08 raicem

With laravel-mix 6, this is no longer necessary. With the following code, and the use of the "react()" function, laravel mix integrates it automatically:

const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

mix.webpackConfig({
  plugins: [
    new ForkTsCheckerWebpackPlugin(),
  ],
}).override((webpackConfig) => {
  webpackConfig.resolve.extensions.push(".tsx");
});

zimudec avatar Aug 11 '21 22:08 zimudec