How to run webpack production build
![how to run webpack production build how to run webpack production build](https://miro.medium.com/max/1200/1*WCAdMi04IFEWdngK8bkFcw.png)
Would this be a matter of just re-configuring WebPack to output to a. I suppose this will work for serverless, but was looking to run via pm2 (with nginx as proxy) as the app will have other factors (e.g., MongoDB) that won’t allow running in serverless (e.g., AWS Lambda). js output (for example ‘build.js’) to run via node or pm2 (npm start that runs ‘node build.js’ or pm2 start build.js). When I run the webpack build I was expecting a. So, how do I run this via node (npm start) or pm2 (pm2 start) (can't use index.html or static/js files). I am using the Vuetify WebPack template (I'm using Vue.js), when I run the npm run build for production (in package.json: “build”: “node build/build.js”) the output is as follows: $ lsĪpp.f7301c212bc5fefd6563.js Īpp.f7301c212bc5fefd6563.js.map .map .map I can view the site if I run under a web server (e.g., nginx), but I want to run my final app using pm2, or running node process. Custom parameters can be passed to webpack by adding two dashes between the npm run buildcommand and your parameters, e.g.
How to run webpack production build how to#
How to run the following node app in production? Webpack build produced an index.html (I assume as it's using html-webpack-plugin). Also, I was able to bring it up on AWS S3 (as static).
![how to run webpack production build how to run webpack production build](https://blog.logrocket.com/wp-content/uploads/2019/01/versatile-webpack-configurations-babel-react.png)
Doing further testing, I can load and bring up my app on a couple local Linux servers (the static content running on one servers, while MongoDB and API running on another server (API running with pm2)). It was my lack of understanding how vue-cli was to build for production (via WebPack) (vue-cli builds static meant to be served via web server). The question is - how can I run this in production using node or pm2 (for example, 'pm2 start myapp.js')?ĭoing some further research and testing, the 'npm run build' built as static. Running 'npm run build' (I'm using the Vuetify/Webpack template) created an index.html and a directory named 'static' with the respective html, css, and js (in 'dist' directory). Thanks much for taking the time to reply.