Skip to content

Commit

Permalink
chore(webpack): directly import fork-ts-checker-webpack-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMcA committed May 14, 2024
1 parent 7da3f25 commit 98e6b1a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
6 changes: 1 addition & 5 deletions client/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ import paths from "./paths.js";
import getClientEnvironment from "./env.js";
import createEnvironmentHash from "./webpack/persistentCache/createEnvironmentHash.js";

const { default: ForkTsCheckerWebpackPlugin } = await import(
process.env.TSC_COMPILE_ON_ERROR === "true"
? "react-dev-utils/ForkTsCheckerWarningWebpackPlugin.js"
: "react-dev-utils/ForkTsCheckerWebpackPlugin.js"
);
import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";

// Source maps are resource heavy and can cause out of memory issue for large source files.
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false";
Expand Down
16 changes: 3 additions & 13 deletions client/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,9 @@ checkBrowsers(paths.appPath, isInteractive)
);
},
(err) => {
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === "true";
if (tscCompileOnError) {
console.log(
chalk.yellow(
"Compiled with the following type errors (you may want to check these before deploying your app):\n"
)
);
printBuildError(err);
} else {
console.log(chalk.red("Failed to compile.\n"));
printBuildError(err);
process.exit(1);
}
console.log(chalk.red("Failed to compile.\n"));
printBuildError(err);
process.exit(1);
}
)
.then(async () => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
"extend": "^3.0.2",
"file-loader": "^6.2.0",
"foreman": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"history": "^5.2.0",
"html-validate": "^8.18.2",
"html-webpack-plugin": "^5.6.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7235,7 +7235,7 @@ foreman@^3.0.1:
mustache "^2.2.1"
shell-quote "^1.6.1"

fork-ts-checker-webpack-plugin@>=6.5.0, fork-ts-checker-webpack-plugin@^6.5.0:
fork-ts-checker-webpack-plugin@>=6.5.0, fork-ts-checker-webpack-plugin@^6.5.0, fork-ts-checker-webpack-plugin@^9.0.2:
version "9.0.2"
resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-9.0.2.tgz#c12c590957837eb02b02916902dcf3e675fd2b1e"
integrity sha512-Uochze2R8peoN1XqlSi/rGUkDQpRogtLFocP9+PGu68zk1BDAKXfdeCdyVZpgTk8V8WFVQXdEz426VKjXLO1Gg==
Expand Down

0 comments on commit 98e6b1a

Please sign in to comment.