updated webpack config
This commit is contained in:
parent
0adb9a152a
commit
92b6da8720
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"presets": "env"
|
||||
}
|
|
@ -4,10 +4,10 @@ import Home from './components/Home.vue'
|
|||
import Login from './components/Login.vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import VueResource from 'vue-resource'
|
||||
import auth from './auth'
|
||||
|
||||
Vue.use(VueResource)
|
||||
Vue.use(VueRouter)
|
||||
import auth from './auth'
|
||||
|
||||
// Set default auth header
|
||||
Vue.http.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('id_token');
|
||||
|
@ -15,7 +15,21 @@ Vue.http.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('id_
|
|||
// Check the user's auth status when the app starts
|
||||
auth.checkAuth()
|
||||
|
||||
export var router = new VueRouter()
|
||||
//export var router = new VueRouter()
|
||||
|
||||
const routes = [
|
||||
{ path: '/home', component: Home },
|
||||
{ path: '/login', component: Login }
|
||||
]
|
||||
|
||||
export const router = new VueRouter({
|
||||
routes // kurz für 'routes: routes'
|
||||
})
|
||||
|
||||
const app = new Vue({
|
||||
router
|
||||
}).$mount('#app')
|
||||
/*
|
||||
|
||||
router.map({
|
||||
'/home': {
|
||||
|
@ -30,4 +44,4 @@ router.redirect({
|
|||
'*': '/home'
|
||||
})
|
||||
|
||||
router.start(App, '#app')
|
||||
router.start(App, '#app')*/
|
|
@ -1,7 +1,9 @@
|
|||
|
||||
// TODO:
|
||||
// * EsLint
|
||||
// * bessere struktur
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
// the main entry of our app
|
||||
|
@ -9,8 +11,12 @@ module.exports = {
|
|||
// output configuration
|
||||
output: {
|
||||
path: __dirname + '/dist/',
|
||||
publicPath: 'assets/dist/',
|
||||
filename: 'app.js'
|
||||
publicPath: 'assets/dist/'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
vue: 'vue/dist/vue.min.js'
|
||||
}
|
||||
},
|
||||
// how modules should be transformed
|
||||
module: {
|
||||
|
@ -24,13 +30,18 @@ module.exports = {
|
|||
// the exclude pattern is important so that we don't
|
||||
// apply babel transform to all the dependencies!
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
/* test: /\.js$/,
|
||||
//exclude: /(node_modules)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
/*options: {
|
||||
presets: ['@babel/preset-env']
|
||||
}*/
|
||||
}*
|
||||
}*/
|
||||
test: /\.js?$/,
|
||||
loader: 'babel-loader',
|
||||
query: {
|
||||
presets: ['env']
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue