我正在尝试 dockerize 一个 React 应用程序。虽然我可以在开发模式下做到,但我不能在生产模式下做到。
我也可以在本地构建它,但是当我尝试 Docker 时出现此错误:
Step 10/14 : RUN npm run build
---> Running in 2c95d18e526c
> x@0.1.0 build /x
> react-scripts build
Creating an optimized production build...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x8fb090 node::Abort() [node]
2: 0x8fb0dc [node]
3: 0xb0322e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
<--- Last few GCs --->
[25:0x4394f50] 192197 ms: Mark-sweep 1375.9 (1444.4) -> 1366.4 (1444.4) MB, 993.9 / 0.0 ms (average …Run Code Online (Sandbox Code Playgroud) class Document<T extends {}>{}和之间有什么区别class Document<T>{}
你能举出一些例子来说明差异吗?