How To Deploy Angularjs App Using Webpack After Uglify On Heroku
Solution 1:
If your web app can run on webpack-dev-server, as long as your code can survive uglification (uglify plugin). All you need is to set up your own mini server, to render your static/ dynamic assets.
I will explain from node.js and npm method.
IF you are deploying to heroku, you will need to use 2 scripts postinstall
and start
. postinstall
basically means you will perform webpack -p
task, production ready all your js files into a single bundled file based on your webpack.config.js. start
will trigger the mini server to render web app.
Both commands will automatically be run on heroku once you push the codes to heroku master using git push heroku master
. npm run postinstall
will be run first follow by npm start
.
DO NOT USE webpack-dev-server for any form of deployment.
Kindly refer to my github repo for more details.
Post a Comment for "How To Deploy Angularjs App Using Webpack After Uglify On Heroku"