"build": "umi build" how to configure --max-old-space-size=8192

umi buildIf you want to set the option when running the command --max-old-space-size=8192, you can modify the script command package.jsonin the file buildto the following:

"build": "node --max-old-space-size=8192 ./node_modules/umi/bin/umi build"

This command will umi builduse the Node.js process settings --max-old-space-sizeoption to set the maximum heap size before running. This may use more memory during the build process, which may speed up the build, but may also make the build process more memory-intensive on the computer.

Note that --max-old-space-sizewhen using the option you need to make sure you have enough memory available on your machine, otherwise it may cause issues with the build process.

おすすめ

転載: blog.csdn.net/a772304419/article/details/131878615