-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
provide baseUrl for development mode #1102
Comments
Not sure your frame is a static page or vue app. If it's a static page, you could set dev server in vue.config.js like this: const express = require('express');
module.exports = {
devServer: {
proxy: null, // string | Object
before: app => {
// the app is the instance of the express app
app.use('/myframe', express.static('path/to/myframe'));
},
},
}; If vue app, set the base for vue router in router.js, Vue router documents base import Vue from 'vue';
import Router from 'vue-router';
import Home from './views/Home.vue';
import About from './views/About.vue';
Vue.use(Router);
export default new Router({
mode: 'history',
base: '/myframe/',
routes: [
{
path: '/',
name: 'home',
component: Home,
},
{
path: '/about',
name: 'about',
component: About,
},
],
}); |
@duduluu |
You might use dev server proxy. See https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md#configuring-proxy localhost:8080 for your main spa, localhost:8081 for your embed spa. Set the vue.config.js of your main project, and cli-service serve both spa. module.exports = {
devServer: {
proxy: {
'/myframe': {
target: 'localhost:8081',
},
}
}
} |
@duduluu you may misunderstood my question. The main spa finding embed spa thing works fine with nginx |
This is a really basic fix, would be nice to have @Akryum fix released |
What problem does this feature solve?
baseUrl
invue.config.js
now only works in production mode.In my case, I need to load the page as an
iframe
.something like
But it turns out
http://localhost/myframe/
will loadapp.js
fromhttp://localhost/
which is not right.PS. I need to inject some data into
iframe
, so it needed to be run in development mode for debuggingWhat does the proposed API look like?
maybe a
devBaseUrl
The text was updated successfully, but these errors were encountered: