2017-09-08 19 views

回答

0

允許您設置節點的命令行選項,通過環境變量:

NODE_OPTIONS=--max-old-space-size=4096 ng bundle 

https://nodejs.org/api/cli.html#cli_node_options_options

還允許你爲什麼你認爲`ng`用來運行NG像

node --max-old-space-size=2048 $(which ng) bundle # not tested by myself 
+0

這些參數?它們用於'節點'過程。 'ng'只使用[這些參數](https://github.com/angular/angular-cli/wiki/build#options) – alexmac

+0

NODE_OPTIONS環境變量由節點進程本身讀取。節點進程實際執行'ng'(參見ng的shebang - https://github.com/angular/angular-cli/blob/master/bin/ng - 調用'ng'在當前環境中執行節點,源代碼爲ng '腳本)。 –

相關問題