Which command do I use to generate the build of a Vue app?
If you've created your project using:
vue init webpack myproject
You'd need to set your NODE_ENV
to production and run, because the project has web pack configured for both development and production:
NODE_ENV=production npm run build
Copy dist/
directory into your website root directory.
If you're deploying with Docker, you'd need an express server, serving the dist/
directory.
Dockerfile
FROM node:carbonRUN mkdir -p /usr/src/appWORKDIR /usr/src/appADD . /usr/src/appRUN npm installENV NODE_ENV=productionRUN npm run build# Remove unused directoriesRUN rm -rf ./srcRUN rm -rf ./build# Port to exposeEXPOSE 8080CMD [ "npm", "start" ]