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 Login from './components/Login.vue'
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
import VueResource from 'vue-resource'
|
import VueResource from 'vue-resource'
|
||||||
|
import auth from './auth'
|
||||||
|
|
||||||
Vue.use(VueResource)
|
Vue.use(VueResource)
|
||||||
Vue.use(VueRouter)
|
Vue.use(VueRouter)
|
||||||
import auth from './auth'
|
|
||||||
|
|
||||||
// Set default auth header
|
// Set default auth header
|
||||||
Vue.http.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('id_token');
|
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
|
// Check the user's auth status when the app starts
|
||||||
auth.checkAuth()
|
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({
|
router.map({
|
||||||
'/home': {
|
'/home': {
|
||||||
|
@ -30,4 +44,4 @@ router.redirect({
|
||||||
'*': '/home'
|
'*': '/home'
|
||||||
})
|
})
|
||||||
|
|
||||||
router.start(App, '#app')
|
router.start(App, '#app')*/
|
|
@ -1,7 +1,9 @@
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// * EsLint
|
|
||||||
// * bessere struktur
|
// * bessere struktur
|
||||||
|
function resolve (dir) {
|
||||||
|
return path.join(__dirname, '..', dir)
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// the main entry of our app
|
// the main entry of our app
|
||||||
|
@ -9,8 +11,12 @@ module.exports = {
|
||||||
// output configuration
|
// output configuration
|
||||||
output: {
|
output: {
|
||||||
path: __dirname + '/dist/',
|
path: __dirname + '/dist/',
|
||||||
publicPath: 'assets/dist/',
|
publicPath: 'assets/dist/'
|
||||||
filename: 'app.js'
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
vue: 'vue/dist/vue.min.js'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// how modules should be transformed
|
// how modules should be transformed
|
||||||
module: {
|
module: {
|
||||||
|
@ -24,13 +30,18 @@ module.exports = {
|
||||||
// the exclude pattern is important so that we don't
|
// the exclude pattern is important so that we don't
|
||||||
// apply babel transform to all the dependencies!
|
// apply babel transform to all the dependencies!
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
/* test: /\.js$/,
|
||||||
exclude: /(node_modules|bower_components)/,
|
//exclude: /(node_modules)/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
/*options: {
|
/*options: {
|
||||||
presets: ['@babel/preset-env']
|
presets: ['@babel/preset-env']
|
||||||
}*/
|
}*
|
||||||
|
}*/
|
||||||
|
test: /\.js?$/,
|
||||||
|
loader: 'babel-loader',
|
||||||
|
query: {
|
||||||
|
presets: ['env']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue