implemented babel-eslint parsing for dynamic import for standard

This commit is contained in:
Kylart 2017-07-27 10:05:02 +02:00
parent 5b54ff6534
commit 6bb2bcd46f
3 changed files with 8 additions and 17 deletions

View File

@ -8,7 +8,7 @@
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": [ "istanbul" ]
"plugins": ["istanbul", "syntax-dynamic-import"]
}
}
}

View File

@ -59,8 +59,10 @@
"devDependencies": {
"autoprefixer": "^7.1.1",
"ava": "^0.19.1",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.0.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.3.2",
@ -73,7 +75,7 @@
"cross-env": "^5.0.0",
"css-loader": "^0.28.4",
"electron": "^1.7.5",
"electron-builder": "^17.1.1",
"electron-builder": "^17.10.0",
"env2": "^2.2.0",
"es6-promise": "^4.1.0",
"eslint-plugin-vue": "^2.0.1",
@ -125,9 +127,9 @@
}
},
"standard": {
"parser": "babel-eslint",
"ignore": [
"test/front.test.js",
"router/index.js",
"public"
]
},

View File

@ -17,7 +17,7 @@ function route (path, view) {
Vue.use(Router)
export function createRouter () {
const router = new Router({
return new Router({
base: __dirname,
mode: 'history',
scrollBehavior: () => ({y: 0}),
@ -32,15 +32,4 @@ export function createRouter () {
{path: '*', redirect: '/'} // TODO: make a custom 404 page
]
})
// Send a pageview to Google Analytics
router.beforeEach((to, from, next) => {
if (typeof ga !== 'undefined') {
ga('set', 'page', to.path)
ga('send', 'pageview')
}
next()
})
return router
}