无法在运行WSL Ubuntu的Windows上构建React-Scripts

问题描述

我的React脚本在以下位置停滞

Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
(node:3580) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
(node:3580) DeprecationWarning: Pass resolveContext instead and use createInnerContext
(node:3580) DeprecationWarning: Resolver: The callback argument was splitted into resolveContext and callback.
(node:3580) DeprecationWarning: Resolver#doResolve: The type arguments (string) is Now a hook argument (Hook). Pass a reference to the hook instead.

这在Windows WSL的Ubuntu中运行。奇怪的是,在构建时似乎几乎没有使用任何资源。w

构建命令为react-app-rewired build --scripts-version react-scripts-ts

这一直很好,但是一个同事在组件中增加了一些延迟加载,我认为这可能是罪魁祸首。对他来说,这很好,但对我和另一个人都没有。

如何向该版本添加日志记录以查找卡住的地方?

解决方法

我在 webpack 4 升级过程中也遇到了同样的问题,所以我更新了 "tsconfig-paths-webpack-plugin": "^3.2.0", 然后弃用警告消失了,所以它对我有用。请尝试,它可能也会删除您的警告,因为这些与 webpack 配置警告有关。