1

I have a VueJS app that I would like to deploy, i'm currently running npm run build to build the app, however I want this app to be in a subdirectory of my website.

The problem i'm having is when building the app, it creates the wrong paths to the css and javascript file.

I have tried using root inside babel.config.js but it gives me an error when I try to build it (root is only allowed in root programmatic options).

Anyone know how I can go about fixing this issue? Any help is greatly appreciated!

1 Answer 1

4

Check out the publicPath and base options:

https://cli.vuejs.org/config/#publicpath
https://router.vuejs.org/api/#base

Possibly you will also need to adjust your webserver config if using history mode:
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

Sign up to request clarification or add additional context in comments.

1 Comment

Hi! Yeah it ended up being history mode, thanks for the answer. :D

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.