Webpack Uglify plugin returns “Killed” on Ubuntu

后端 未结 4 545
[愿得一人]
[愿得一人] 2021-02-04 05:42

On my remote server (Ubuntu 14.04 x64), whenever I try to uglify my bundles, the process simply returns \"Killed\". When I don\'t uglify, it\'s just fine.

Has anyone ru

4条回答
  •  無奈伤痛
    2021-02-04 06:19

    Same thing happened with me while Digital Ocean VPS using, as mentioned above - that happens because of building takes to much RAM for your machine, so it's "out of memory usage".

    To solve this you can minimize RAM usage while file compiling via ---max_old_space_size option, here is an advanced example of usage

    node --max_old_space_size=1096 node_modules/webpack/.bin/webpack.js
    

    Of course you can choose any size, also you can do the same with webpack-dev-server. And you don't need to add the swap space until it will be really needed for other purposes, such as you run this command only once to compile the bundle.js file.

提交回复
热议问题