How can I run:
ng serve --prod
with pm2?
ng serve from angular-cli, Angular2. I\'m running on DigitalOcean.
I have tried to test with ht
With PM2 recent version
pm2 ecosystem
than update
ecosystem.config.js as follows
module.exports = {
apps : [{
name: 'demoapp',
script: 'node_modules/@angular/cli/bin/ng',
args: 'serve --host [yourip] --disable-host-check',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'development'
},
env_production: {
NODE_ENV: 'production'
}
}],
deploy : {
}
};
finally
pm2 start & pm2 save