diff --git a/.babelrc b/.babelrc index 5fcaeaf..cd9c654 100644 --- a/.babelrc +++ b/.babelrc @@ -8,7 +8,7 @@ "env": { "test": { "presets": ["env", "stage-2"], - "plugins": [ "istanbul" ] + "plugins": ["istanbul", "syntax-dynamic-import"] } } } \ No newline at end of file diff --git a/package.json b/package.json index 8d69e6c..d83e08c 100644 --- a/package.json +++ b/package.json @@ -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" ] }, diff --git a/router/index.js b/router/index.js index f9f0969..581a108 100644 --- a/router/index.js +++ b/router/index.js @@ -17,10 +17,10 @@ function route (path, view) { Vue.use(Router) export function createRouter () { - const router = new Router({ + return new Router({ base: __dirname, mode: 'history', - scrollBehavior: () => ({ y: 0 }), + scrollBehavior: () => ({y: 0}), routes: [ route('/', 'index'), route('/downloader', 'downloader'), @@ -29,18 +29,7 @@ export function createRouter () { route('/localPage', 'localPage'), route('/watchList', 'watchList'), // Global redirect for 404 - { path: '*', redirect: '/' } // TODO: make a custom 404 page + {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 }