Browse Source

目录清理,package依赖清理

xiaoct 7 years ago
parent
commit
2202b5028a
2 changed files with 2 additions and 71 deletions
  1. 0 65
      main.js
  2. 2 6
      package.json

+ 0 - 65
main.js

@@ -1,65 +0,0 @@
-const {app, BrowserWindow} = require('electron')
-const path = require('path')
-const url = require('url')
-const pkg = require('./package.json')
-
-// 保持一个对于 window 对象的全局引用,如果你不这样做,
-// 当 JavaScript 对象被垃圾回收, window 会被自动地关闭
-let win
-
-function createWindow () {
-  // 创建浏览器窗口。
-  win = new BrowserWindow({width: 800, height: 600})
-
-  // 然后加载应用的 index.html。
-  // package中的DEV为true时,开启调试窗口。为false时使用编译发布版本
-  if(pkg.DEV){
-    win.loadURL('http://localhost:8000/')
-  }else{
-    win.loadURL(url.format({
-      pathname: path.join(__dirname, './build/index.html'),
-      protocol: 'file:',
-      slashes: true
-    }))
-  }
-
-  // 打开开发者工具。
-  // win.webContents.openDevTools()
-
-  // 当 window 被关闭,这个事件会被触发。
-  win.on('closed', () => {
-    // 取消引用 window 对象,如果你的应用支持多窗口的话,
-    // 通常会把多个 window 对象存放在一个数组里面,
-    // 与此同时,你应该删除相应的元素。
-    win = null
-  })
-}
-
-// Electron 会在初始化后并准备
-// 创建浏览器窗口时,调用这个函数。
-// 部分 API 在 ready 事件触发后才能使用。
-app.on('ready', createWindow)
-
-// 当全部窗口关闭时退出。
-app.on('window-all-closed', () => {
-  // 在 macOS 上,除非用户用 Cmd + Q 确定地退出,
-  // 否则绝大部分应用及其菜单栏会保持激活。
-  if (process.platform !== 'darwin') {
-    app.quit()
-  }
-})
-
-app.on('activate', () => {
-  // 在macOS上,当单击dock图标并且没有其他窗口打开时,
-  // 通常在应用程序中重新创建一个窗口。
-  if (win === null) {
-    createWindow()
-  }
-})
-
-// 在这文件,你可以续写应用剩下主进程代码。
-// 也可以拆分成几个文件,然后用 require 导入。
-// 在这里可以添加一些electron相关的其他模块,比如nodejs的一些原生模块
-// 文件模块
-// const BTFile = require('./sys_modules/BTFile')
-// BTFile.getAppPath()

+ 2 - 6
package.json

@@ -1,15 +1,12 @@
 {
+  "name": "bi-web",
   "private": true,
-  "main": "main.js",
-  "DEV": false,
   "version": "0.0.1",
   "scripts": {
     "start": "roadhog server",
     "build": "roadhog build",
     "lint": "eslint --ext .js src test",
-    "precommit": "npm run lint",
-    "electron": "electron .",
-    "electron-packager": "electron-packager . myClient --win --out ../myClient --arch=x64 --app-version=0.0.1 --electron-version=2.0.0"
+    "precommit": "npm run lint"
   },
   "dependencies": {
     "ant-design-pro": "^2.0.0-beta.2",
@@ -38,7 +35,6 @@
   "devDependencies": {
     "babel-plugin-dva-hmr": "^0.3.2",
     "babel-plugin-import": "^1.8.0",
-    "electron": "^3.0.1",
     "eslint": "^4.19.1",
     "eslint-config-standard": "^11.0.0",
     "eslint-config-umi": "^0.1.4",