Skip to content

Commit ffd8ce9

Browse files
committed
fix: async true working with latest react-dev-utils
1 parent fa35578 commit ffd8ce9

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

config/webpack.config.dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const getClientEnvironment = require('./env');
1919
const paths = require('./paths');
2020
const { loaders } = require('./webpack.base');
2121

22-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
22+
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
2323
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2424
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
2525

@@ -183,7 +183,7 @@ module.exports = {
183183
tslint: paths.appTsLint,
184184
watch: [paths.appSrc],
185185
checkSyntacticErrors: true,
186-
async: false,
186+
async: true,
187187
useTypescriptIncrementalApi: true,
188188
formatter: typescriptFormatter
189189
})

scripts/start.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,21 @@ checkBrowsers(paths.appPath)
9090
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
9191
const appName = require(paths.appPackageJson).name;
9292
const urls = prepareUrls(protocol, HOST, port);
93+
const devSocket = {
94+
warnings: warnings =>
95+
devServer.sockWrite(devServer.sockets, 'warnings', warnings),
96+
errors: errors =>
97+
devServer.sockWrite(devServer.sockets, 'errors', errors),
98+
};
9399
// Create a webpack compiler that is configured with custom messages.
94-
const compiler = createCompiler(
95-
webpack,
96-
config,
100+
const compiler = createCompiler({
97101
appName,
102+
config,
103+
devSocket,
98104
urls,
99-
paths.useYarn
100-
);
105+
useTypeScript: true,
106+
webpack,
107+
});
101108
// Load proxy config
102109
const proxySetting = require(paths.appPackageJson).proxy;
103110
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);

0 commit comments

Comments
 (0)