This topic explains about simplest production-ready deployment of your Angular Report Viewer application to a remote server by creating a production build.
To create a production build run the following command and copy the output directory to a web server.
node_modules\.bin\ng build --prod
Please refer to the angular deployment documentation to know more about deploying your Angular application.
If you get error FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
add --max_old_space_size=xx
space in ngc.cmd
and ng.cmd
file from node_modules\.bin
folder.
Modify ngc.cmd
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" --max_old_space_size=8192 "%~dp0\..\@angular\compiler-cli\src\main.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node --max_old_space_size=8192 "%~dp0\..\@angular\compiler-cli\src\main.js" %*
)
Modify ng.cmd
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" --max_old_space_size=8192 "%~dp0\..\@angular\cli\bin\ng" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node --max_old_space_size=8192 "%~dp0\..\@angular\cli\bin\ng" %*
)