正在显示
5 个修改的文件
包含
23 行增加
和
13 行删除
| ... | @@ -24,7 +24,7 @@ else build() | ... | @@ -24,7 +24,7 @@ else build() |
| 24 | 24 | ||
| 25 | function clean () { | 25 | function clean () { |
| 26 | del.sync(['build/*', '!build/icons', '!build/icons/icon.*']) | 26 | del.sync(['build/*', '!build/icons', '!build/icons/icon.*']) |
| 27 | - console.log(`\n${doneLog}\n`) | 27 | + console.log(`\n${doneLog}clear done`) |
| 28 | process.exit() | 28 | process.exit() |
| 29 | } | 29 | } |
| 30 | 30 | ... | ... |
| ... | @@ -7,6 +7,7 @@ const { dependencies } = require('../package.json') | ... | @@ -7,6 +7,7 @@ const { dependencies } = require('../package.json') |
| 7 | const webpack = require('webpack') | 7 | const webpack = require('webpack') |
| 8 | 8 | ||
| 9 | const MinifyPlugin = require("babel-minify-webpack-plugin"); | 9 | const MinifyPlugin = require("babel-minify-webpack-plugin"); |
| 10 | +const { CleanWebpackPlugin } = require('clean-webpack-plugin') | ||
| 10 | 11 | ||
| 11 | function resolve(dir) { | 12 | function resolve(dir) { |
| 12 | return path.join(__dirname, '..', dir) | 13 | return path.join(__dirname, '..', dir) |
| ... | @@ -53,7 +54,10 @@ let mainConfig = { | ... | @@ -53,7 +54,10 @@ let mainConfig = { |
| 53 | path: path.join(__dirname, '../dist/electron') | 54 | path: path.join(__dirname, '../dist/electron') |
| 54 | }, | 55 | }, |
| 55 | plugins: [ | 56 | plugins: [ |
| 56 | - new webpack.NoEmitOnErrorsPlugin() | 57 | + new webpack.NoEmitOnErrorsPlugin(), |
| 58 | + new CleanWebpackPlugin({ | ||
| 59 | + cleanOnceBeforeBuildPatterns: resolve('dist/electron') | ||
| 60 | + }) | ||
| 57 | ], | 61 | ], |
| 58 | resolve: { | 62 | resolve: { |
| 59 | alias: { | 63 | alias: { | ... | ... |
此文件的差异被折叠,
点击展开。
| ... | @@ -70,7 +70,7 @@ | ... | @@ -70,7 +70,7 @@ |
| 70 | "vuex-electron": "^1.0.3" | 70 | "vuex-electron": "^1.0.3" |
| 71 | }, | 71 | }, |
| 72 | "devDependencies": { | 72 | "devDependencies": { |
| 73 | - "@babel/core": "^7.6.0", | 73 | + "@babel/core": "^7.6.2", |
| 74 | "@babel/plugin-proposal-class-properties": "^7.0.0", | 74 | "@babel/plugin-proposal-class-properties": "^7.0.0", |
| 75 | "@babel/plugin-proposal-decorators": "^7.6.0", | 75 | "@babel/plugin-proposal-decorators": "^7.6.0", |
| 76 | "@babel/plugin-proposal-do-expressions": "^7.6.0", | 76 | "@babel/plugin-proposal-do-expressions": "^7.6.0", |
| ... | @@ -87,28 +87,29 @@ | ... | @@ -87,28 +87,29 @@ |
| 87 | "@babel/plugin-proposal-throw-expressions": "^7.0.0", | 87 | "@babel/plugin-proposal-throw-expressions": "^7.0.0", |
| 88 | "@babel/plugin-syntax-dynamic-import": "^7.0.0", | 88 | "@babel/plugin-syntax-dynamic-import": "^7.0.0", |
| 89 | "@babel/plugin-syntax-import-meta": "^7.0.0", | 89 | "@babel/plugin-syntax-import-meta": "^7.0.0", |
| 90 | - "@babel/plugin-transform-runtime": "^7.6.0", | 90 | + "@babel/plugin-transform-runtime": "^7.6.2", |
| 91 | "@babel/polyfill": "^7.6.0", | 91 | "@babel/polyfill": "^7.6.0", |
| 92 | - "@babel/preset-env": "^7.6.0", | 92 | + "@babel/preset-env": "^7.6.2", |
| 93 | - "@babel/register": "^7.6.0", | 93 | + "@babel/register": "^7.6.2", |
| 94 | - "@babel/runtime": "^7.6.0", | 94 | + "@babel/runtime": "^7.6.2", |
| 95 | "ajv": "^6.10.2", | 95 | "ajv": "^6.10.2", |
| 96 | "babel-eslint": "^9.0.0", | 96 | "babel-eslint": "^9.0.0", |
| 97 | "babel-loader": "^8.0.6", | 97 | "babel-loader": "^8.0.6", |
| 98 | "babel-minify-webpack-plugin": "^0.3.1", | 98 | "babel-minify-webpack-plugin": "^0.3.1", |
| 99 | "cfonts": "^2.4.5", | 99 | "cfonts": "^2.4.5", |
| 100 | "chalk": "^2.4.2", | 100 | "chalk": "^2.4.2", |
| 101 | + "clean-webpack-plugin": "^3.0.0", | ||
| 101 | "copy-webpack-plugin": "^5.0.4", | 102 | "copy-webpack-plugin": "^5.0.4", |
| 102 | - "cross-env": "^5.2.1", | 103 | + "cross-env": "^6.0.0", |
| 103 | "css-loader": "^3.1.0", | 104 | "css-loader": "^3.1.0", |
| 104 | "del": "^5.0.0", | 105 | "del": "^5.0.0", |
| 105 | - "electron": "^6.0.9", | 106 | + "electron": "^6.0.10", |
| 106 | "electron-builder": "^21.2.0", | 107 | "electron-builder": "^21.2.0", |
| 107 | "electron-devtools-installer": "^2.2.4", | 108 | "electron-devtools-installer": "^2.2.4", |
| 108 | "eslint": "^6.4.0", | 109 | "eslint": "^6.4.0", |
| 109 | - "eslint-config-standard": "^13.0.1", | 110 | + "eslint-config-standard": "^14.1.0", |
| 110 | "eslint-friendly-formatter": "^4.0.1", | 111 | "eslint-friendly-formatter": "^4.0.1", |
| 111 | - "eslint-loader": "^2.2.1", | 112 | + "eslint-loader": "^3.0.0", |
| 112 | "eslint-plugin-html": "^6.0.0", | 113 | "eslint-plugin-html": "^6.0.0", |
| 113 | "eslint-plugin-import": "^2.18.2", | 114 | "eslint-plugin-import": "^2.18.2", |
| 114 | "eslint-plugin-node": "^9.2.0", | 115 | "eslint-plugin-node": "^9.2.0", | ... | ... |
| ... | @@ -4,7 +4,7 @@ import config from '@config' | ... | @@ -4,7 +4,7 @@ import config from '@config' |
| 4 | import setIpc from './ipcMain' | 4 | import setIpc from './ipcMain' |
| 5 | import electronDevtoolsInstaller, { VUEJS_DEVTOOLS } from 'electron-devtools-installer' | 5 | import electronDevtoolsInstaller, { VUEJS_DEVTOOLS } from 'electron-devtools-installer' |
| 6 | 6 | ||
| 7 | -const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080` : `file://${__dirname}/index.html` | 7 | +const winURL = process.env.NODE_ENV === 'development' ? 'http://localhost:9080' : `file://${__dirname}/index.html` |
| 8 | var loadWindow = null | 8 | var loadWindow = null |
| 9 | var mainWindow = null | 9 | var mainWindow = null |
| 10 | 10 | ||
| ... | @@ -16,12 +16,17 @@ function createMainWindow () { | ... | @@ -16,12 +16,17 @@ function createMainWindow () { |
| 16 | height: 800, | 16 | height: 800, |
| 17 | useContentSize: true, | 17 | useContentSize: true, |
| 18 | width: 1700, | 18 | width: 1700, |
| 19 | + minWidth: 1366, | ||
| 19 | show: false, | 20 | show: false, |
| 20 | frame: config.IsUseSysTitle, | 21 | frame: config.IsUseSysTitle, |
| 21 | titleBarStyle: 'hidden', | 22 | titleBarStyle: 'hidden', |
| 22 | webPreferences: { | 23 | webPreferences: { |
| 23 | nodeIntegration: true, | 24 | nodeIntegration: true, |
| 24 | - webSecurity: false | 25 | + webSecurity: false, |
| 26 | + // 如果是开发模式可以使用devTools | ||
| 27 | + devTools: process.env.NODE_ENV === 'development', | ||
| 28 | + // 在macos中启用橡皮动画 | ||
| 29 | + scrollBounce: process.platform === 'darwin' | ||
| 25 | } | 30 | } |
| 26 | }) | 31 | }) |
| 27 | 32 | ... | ... |
-
请 注册 或 登录 后发表评论