-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support publicPath in vue.config.js #98
Conversation
if publicPath is set in vue.config.js in order to host the application under a path prefix, the router on the server side didn't find a matching route
Some minor additions: Implementing const prepareUrlForRouting = url => {
const { BASE_URL } = process.env
return url.startsWith(BASE_URL.replace(/\/$/, ''))
? url.substr(BASE_URL.length)
: url
} We could also change this line in const url = `http://localhost:${config.port}${service.projectOptions.publicPath}` When testing this, I found the changes in 2e729de to not be necessary to make the app.get(`${publicPath}*`, (req, res, next) => {
if (config.skipRequests(req)) {
return next()
}
ssr(req, res)
}) |
I will adapt my PR with your remarks. About:
This only happens when running the production build. The requests to download the javascript bundle all return the html content of the page instead of the static files. |
I have this PR running in our project and tested it to the extend of our needs. AFAIK this seems good to go 👍 |
fyi: While we are waiting for this to get merged I've published a fork on npm, which includes this and other PRs. Looking forward to seeing this merged! |
👍 |
Fixes #97