diff --git a/src/background.ts b/src/background.ts index 3ed48d43..8db9e8a3 100644 --- a/src/background.ts +++ b/src/background.ts @@ -34,10 +34,10 @@ export type TheDeskInfoObject = typeof TheDeskInfo; declare const __static: string; ipcMain.on('thedesk-info', (event: Event) => { - event.returnValue = Object.assign({ + event.returnValue = Object.assign({ productName: app.getName(), homePage: homepage, - versions: Object.assign(pick(process.versions, ["chrome","electron","node"]), {internal: app.getVersion()}), + versions: Object.assign(pick(process.versions, ["chrome", "electron", "node"]), { internal: app.getVersion() }), }, TheDeskInfo) }) @@ -168,7 +168,7 @@ class Application { }) let openUrl = (event: Event, url: string) => { - if (url === process.env.WEBPACK_DEV_SERVER_URL + options.loadPath) { + if (isDevelopment && url === process.env.WEBPACK_DEV_SERVER_URL + options.loadPath) { return } event.preventDefault() @@ -300,9 +300,9 @@ class ApplicationMenu { { type: 'separator' }, { role: 'front' }, ] : [ - { role: 'minimize' }, - { role: 'close' }, - ] + { role: 'minimize' }, + { role: 'close' }, + ] return { label: 'Window', submenu: windowMenu, diff --git a/src/views/loadComponents.ts b/src/views/loadComponents.ts index 5e5cba2d..b531f205 100644 --- a/src/views/loadComponents.ts +++ b/src/views/loadComponents.ts @@ -1,7 +1,8 @@ 'use strict' -import upperFirst from 'lodash/upperFirst' -import camelCase from 'lodash/camelCase' +import Vue from 'vue'; +import { upperFirst } from 'lodash' +import { camelCase } from 'lodash' const requireComponent = require.context( '@/components', @@ -9,19 +10,14 @@ const requireComponent = require.context( /Base[A-Z]\w+\.(vue|js)$/ ) -export default function(Vue) { - requireComponent.keys().forEach(fileName => { - const componentConfig = requireComponent(fileName) - - const componentName = upperFirst( - camelCase(fileName - .split('/') - .pop() - .replace(/\.\w+$/, '') - ) - ) - - - Vue.component(componentName, componentConfig.default || componentConfig) -}) +export default function() { + requireComponent.keys().forEach((fileName: string) => { + const componentConfig = requireComponent(fileName) + const componentName = upperFirst( + camelCase( + fileName.replace(/^\.\/(.*)\.\w+$/, '$1') + ) + ) + Vue.component(componentName, componentConfig.default || componentConfig) + }) }