1

I have Vue app, created with vue-cli. This is semi-developed application. I want show to customer what we have now. So, I want to deploy what we have.

If I run script npm run build can I continue project development after building? What best practices for deploying not finished app?

P. S. I'm new in vue. I know, that my question can be stupid. Anyway, do not place minuses, please.

Alex
  • 685
  • 3
  • 9
  • 20
  • Just [google](https://www.google.co.uk/search?q=how+to+deploy+node+js+application&oq=how+to+deploy+node+&aqs=chrome.0.0j69i57j0l4.4487j0j7&sourceid=chrome&ie=UTF-8) it.... – webnoob Dec 25 '17 at 18:08

2 Answers2

2

You need to buy a vps hosting and install node.js. That's all, you can deploy your app.
Also you can make a simple back-end on node+express and put there your 'dist' folder after npm run build and this will be your demo app.

ramazan793
  • 669
  • 1
  • 9
  • 23
  • I know about VPS, and I have it already. VPS configured for vue.js. If i understand correct, "npm run build" command modifies index.html for production. But, I want continue develop project after publishing on my local machine. Can I do it? – Alex Dec 25 '17 at 20:30
  • Of course you can. `npm run build` just creating a new uglified front-end of your project, which you can use for production. Just in production server copy `dist` folder and set this as a `static` files(with express like `app.use(express.static(path.join(__dirname, '../dist')));`). If you want, I can show you how I did this with my project. – ramazan793 Dec 26 '17 at 09:29
  • many thanks for explanation. I built project and uploaded it to VPS, but without express.static. Anyway, all working normal. And can I asking you about another nooby question? What about global variables? For example,I have front-end, developed with VUE and service part, developed with Python. Is it possible store service connection URL in global variable? This is data must be acceptable even client closes browser.With other words,if I close browser and open it at next time I will be able get data from service by URL stored in variable. – Alex Dec 26 '17 at 16:31
  • @Alex Do you mean API? If you want to get data from your server anytime you just need to add get request handler in your server, php: http://php.net/manual/en/reserved.variables.get.php. If you mean temporary data for browsers use cookies – ramazan793 Dec 26 '17 at 17:52
  • No, I mean another think. I found decision here: [link](https://stackoverflow.com/questions/44750008/vuejs-configuration-using-a-global-variable) – Alex Dec 26 '17 at 18:22
2

Yes. npm run build will build and package your app into the dist folder. Everything under your src folder will remain as it is. You can continue working on your app normally and build it as often as you want. There aren't really best practices for this. I would just make sure it doesn't touch production data until it's actually ready.

Steven B.
  • 8,962
  • 3
  • 24
  • 45