Build & Deploy: Vue.js app with router and other dependencies
I have a vue-cli (webpack) + vue-router proyect finished.
On my static/ folder I have included dependencies: jquery, jquery-ui, datatables, jstree, etc.
I've been working with NO problems running.
npm run dev
The app works. But now at:
npm run build
...well all includes from static/ are injected, no problem about that. But it's like the vue app it's not displaying anything, and no errors prompted either in the console.
You navigate to /index.html and that's it, there is no redirect to the /login path of the router like it used to be in development.
Here is my scenario:
-
main.js
import Vue from 'vue'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import App from './App'
import Login from './components/Login.vue'
Vue.use(VueRouter)
Vue.use(VueResource)
Vue.component('login', Login)
const routes = [
{path: '/', redirect: '/login'},
{path: '/login', name: 'login', component: Login}
]
const router = new VueRouter({
mode: 'history',
base: '/',
routes
})
var vm = new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
})
webpack.conf.js and every other config is set as vue-cli @webpack.
I've read everywhere buy I have no clue about this for the moment. I appreciate the help.
Please or to participate in this conversation.