text: import {app, BrowserWindow, Menu} from 'electron'
  import template from './menu';
  
  const electron = require('electron')
  const dialog = electron.dialog;
  
  /**
   * Set `__static` path to static files in production
   * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
   */
  if (process.env.NODE_ENV !== 'development') {
      global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
  }
  
  let mainWindow
  const winURL = process.env.NODE_ENV === 'development'
      ? `http://localhost:9080`
      : `file://${__dirname}/index.html`
  
  
  function createWindow() {
      /**
       * Initial window options
       */
      mainWindow = new BrowserWindow({
          width: 1200,
          height: 800,
          useContentSize: true,
      });
  
      mainWindow.loadURL(winURL);
      mainWindow.webContents.openDevTools();
  
      const menu = Menu.buildFromTemplate(template)
      Menu.setApplicationMenu(menu)
  
      mainWindow.on('close', (even) => {
          // dialog.showErrorBox('even', 'windows-close');
          even.preventDefault();
          mainWindow.destroy();
      })
  
      mainWindow.on('closed', () => {
          mainWindow = null
      })
  }
  
  app.on('ready', createWindow);
  
  app.on('window-all-closed', () => {
      if (process.platform !== 'darwin') {
          app.quit()
      }
  });
  
  app.on('activate', () => {
      if (mainWindow === null) {
          createWindow()
      }
  });
  
  
  