Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Vue-cli webpack compilation memory overflow
Vue-cli webpack compilation memory overflow
I am writing a vue project recently. When I was doing yarn dev, I often found that the compilation crashed, and then I needed yarn dev.

The main error messages are as follows:

The main problem is the memory limitation of node, and many online solutions are based on the previous version of vue-cli.

At that time, the script of vue-cli still directly used the node xxxx command, and it was impossible to directly add node running parameters.

The basic solution is to increase memory. If you use a new version of vue-cli, the dev in the script will hide the node parameters:

You need to modify webpack.cmd directly:

The file path is located at:

node_modules/。 bin/webpack.cmd

Just add parameters to the node command.

Previous file content:

Modified file content: