2

I've built a vue.js app using vue-cli 3.0 and everything is great.

Now I'm wanting to deploy it into production, but I need to deploy it into a sub folder, not the root, i.e.:

https://example.com/myvueapp/*

I've built the production distribution with npm run build but the problem is that the links to the .js files etc are all /js/vendor.9e469b3e.js. How would I make this /myvueapp/js/vendor.9e469b3e.js?

I've found other answers that say "change the webpack config file". But I don't have a webpack config file anywhere I can see?

enter image description here

1
  • You should have webpack as your bundler, so there should be webpack config somewhere over there. Try to look for production webpack build and in output property set the path where you want to generate the production files. Commented Mar 15, 2018 at 5:33

1 Answer 1

5

Using vue-cli 3 you can set the base URL in the vue.config.js file. It would look something like this

module.exports = {
  ...
  baseUrl: 'myvueapp',
  ...
}
Sign up to request clarification or add additional context in comments.

1 Comment

Would you set production/dev environments using the normal .env.production config files?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.