切换导航条
切换导航条
当前项目
正在载入...
登录
术习电报
/
electron-vue-template
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
作者
张恒
2020-03-08 17:38:35 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
提交
043788d48f40e531902b6adc658b723d3b9468e2
043788d4
1 个父辈
d63a6f24
更新依赖,添加新的全局文件夹变量对应文档中dll调用
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
56 行增加
和
17 行删除
.electron-vue/webpack.main.config.js
.electron-vue/webpack.renderer.config.js
config/index.js
package-lock.json
package.json
src/index.ejs
src/renderer/components/LandingPage.vue
src/renderer/components/LandingPage/SystemInformation.vue
.electron-vue/webpack.main.config.js
查看文件 @
043788d
...
...
@@ -2,12 +2,14 @@
process
.
env
.
BABEL_ENV
=
'main'
const
os
=
require
(
'os'
)
const
path
=
require
(
'path'
)
const
{
dependencies
}
=
require
(
'../package.json'
)
const
webpack
=
require
(
'webpack'
)
const
MinifyPlugin
=
require
(
"babel-minify-webpack-plugin"
);
const
{
CleanWebpackPlugin
}
=
require
(
'clean-webpack-plugin'
)
const
HappyPack
=
require
(
'happypack'
)
const
HappyThreadPool
=
HappyPack
.
ThreadPool
({
size
:
os
.
cpus
().
length
})
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
'..'
,
dir
)
...
...
@@ -35,7 +37,7 @@ let mainConfig = {
// },
{
test
:
/
\.
js$/
,
use
:
'
babel-loader
'
,
use
:
'
happypack/loader?id=MainHappyBabel
'
,
exclude
:
/node_modules/
},
{
...
...
@@ -57,6 +59,16 @@ let mainConfig = {
new
webpack
.
NoEmitOnErrorsPlugin
(),
new
CleanWebpackPlugin
({
cleanOnceBeforeBuildPatterns
:
resolve
(
'dist/electron'
)
}),
new
HappyPack
({
id
:
"MainHappyBabel"
,
loaders
:
[{
loader
:
'babel-loader'
,
options
:
{
cacheDirectory
:
true
}
}],
threadPool
:
HappyThreadPool
})
],
resolve
:
{
...
...
.electron-vue/webpack.renderer.config.js
查看文件 @
043788d
...
...
@@ -2,6 +2,7 @@
process
.
env
.
BABEL_ENV
=
'renderer'
const
os
=
require
(
'os'
)
const
path
=
require
(
'path'
)
const
{
dependencies
}
=
require
(
'../package.json'
)
const
webpack
=
require
(
'webpack'
)
...
...
@@ -12,7 +13,10 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
const
MiniCssExtractPlugin
=
require
(
'mini-css-extract-plugin'
)
const
HtmlWebpackPlugin
=
require
(
'html-webpack-plugin'
)
const
TerserPlugin
=
require
(
'terser-webpack-plugin'
);
const
HardSourceWebpackPlugin
=
require
(
'hard-source-webpack-plugin'
);
const
{
VueLoaderPlugin
}
=
require
(
'vue-loader'
)
const
HappyPack
=
require
(
'happypack'
)
const
HappyThreadPool
=
HappyPack
.
ThreadPool
({
size
:
os
.
cpus
().
length
})
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
'..'
,
dir
)
...
...
@@ -24,7 +28,7 @@ function resolve(dir) {
* that provide pure *.vue files that need compiling
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals
*/
let
whiteListedModules
=
[
'vue'
,
"element-ui"
]
let
whiteListedModules
=
[
'vue'
,
"element-ui"
]
let
rendererConfig
=
{
devtool
:
'#cheap-module-eval-source-map'
,
...
...
@@ -69,7 +73,7 @@ let rendererConfig = {
},
{
test
:
/
\.
js$/
,
use
:
'
babel-loader
'
,
use
:
'
happypack/loader?id=HappyRendererBabel
'
,
exclude
:
/node_modules/
},
{
...
...
@@ -164,7 +168,18 @@ let rendererConfig = {
nodeModules
:
false
}),
new
webpack
.
HotModuleReplacementPlugin
(),
new
webpack
.
NoEmitOnErrorsPlugin
()
new
webpack
.
NoEmitOnErrorsPlugin
(),
new
HardSourceWebpackPlugin
(),
new
HappyPack
({
id
:
'HappyRendererBabel'
,
loaders
:
[{
loader
:
'babel-loader'
,
options
:
{
cacheDirectory
:
true
}
}],
threadPool
:
HappyThreadPool
}),
],
output
:
{
filename
:
'[name].js'
,
...
...
@@ -187,7 +202,8 @@ let rendererConfig = {
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
{
rendererConfig
.
plugins
.
push
(
new
webpack
.
DefinePlugin
({
'__static'
:
`"
${
path
.
join
(
__dirname
,
'../static'
).
replace
(
/
\\
/g
,
'\\\\'
)}
"`
'__static'
:
`"
${
path
.
join
(
__dirname
,
'../static'
).
replace
(
/
\\
/g
,
'\\\\'
)}
"`
,
'__lib'
:
`"
${
path
.
join
(
__dirname
,
`../
${
config
.
DllFolder
}
`
).
replace
(
/
\\
/g
,
'\\\\'
)}
"`
})
)
}
...
...
config/index.js
查看文件 @
043788d
...
...
@@ -10,5 +10,6 @@ module.exports = {
port
:
9080
},
UseStartupChart
:
true
,
IsUseSysTitle
:
true
IsUseSysTitle
:
true
,
DllFolder
:
''
}
...
...
package-lock.json
查看文件 @
043788d
此文件的差异被折叠,
点击展开。
package.json
查看文件 @
043788d
...
...
@@ -20,6 +20,7 @@
"update:serve"
:
"node server/index.js"
},
"build"
:
{
"extraFiles"
:
[],
"publish"
:
[
{
"provider"
:
"generic"
,
...
...
@@ -71,9 +72,8 @@
"dependencies"
:
{
"axios"
:
"^0.19.2"
,
"date-fns"
:
"^2.10.0"
,
"electron-updater"
:
"^4.2.
2
"
,
"electron-updater"
:
"^4.2.
4
"
,
"element-ui"
:
"^2.13.0"
,
"ffi-napi"
:
"^2.4.6"
,
"fs-extra"
:
"^8.1.0"
,
"js-cookie"
:
"^2.2.1"
,
"nedb"
:
"^1.8.0"
,
...
...
@@ -85,7 +85,7 @@
"vuex-electron"
:
"^1.0.3"
},
"devDependencies"
:
{
"@babel/core"
:
"^7.8.
6
"
,
"@babel/core"
:
"^7.8.
7
"
,
"@babel/plugin-proposal-class-properties"
:
"^7.8.3"
,
"@babel/plugin-proposal-decorators"
:
"^7.8.3"
,
"@babel/plugin-proposal-do-expressions"
:
"^7.8.3"
,
...
...
@@ -103,10 +103,10 @@
"@babel/plugin-syntax-dynamic-import"
:
"^7.8.3"
,
"@babel/plugin-syntax-import-meta"
:
"^7.8.3"
,
"@babel/plugin-transform-runtime"
:
"^7.8.3"
,
"@babel/polyfill"
:
"^7.8.
3
"
,
"@babel/preset-env"
:
"^7.8.
6
"
,
"@babel/polyfill"
:
"^7.8.
7
"
,
"@babel/preset-env"
:
"^7.8.
7
"
,
"@babel/register"
:
"^7.8.6"
,
"@babel/runtime"
:
"^7.8.
4
"
,
"@babel/runtime"
:
"^7.8.
7
"
,
"ajv"
:
"^6.12.0"
,
"babel-eslint"
:
"^9.0.0"
,
"babel-loader"
:
"^8.0.6"
,
...
...
@@ -115,10 +115,10 @@
"chalk"
:
"^3.0.0"
,
"clean-webpack-plugin"
:
"^3.0.0"
,
"copy-webpack-plugin"
:
"^5.1.1"
,
"cross-env"
:
"^7.0.
1
"
,
"cross-env"
:
"^7.0.
2
"
,
"css-loader"
:
"^3.4.2"
,
"del"
:
"^5.1.0"
,
"electron"
:
"^8.
0.3
"
,
"electron"
:
"^8.
1.0
"
,
"electron-builder"
:
"^22.3.6"
,
"electron-devtools-installer"
:
"^2.2.4"
,
"eslint"
:
"^6.8.0"
,
...
...
@@ -132,6 +132,8 @@
"eslint-plugin-standard"
:
"^4.0.0"
,
"express"
:
"^4.17.1"
,
"file-loader"
:
"^5.1.0"
,
"happypack"
:
"^5.0.1"
,
"hard-source-webpack-plugin"
:
"^0.13.1"
,
"html-webpack-plugin"
:
"^3.2.0"
,
"mini-css-extract-plugin"
:
"0.9.0"
,
"multispinner"
:
"^0.2.1"
,
...
...
src/index.ejs
查看文件 @
043788d
...
...
@@ -16,6 +16,7 @@
<
% if (!process.browser) { %>
<script>
if
(
process
.
env
.
NODE_ENV
!==
'development'
)
window
.
__static
=
require
(
'path'
).
join
(
__dirname
,
'/static'
).
replace
(
/
\\
/g
,
'\\\\'
)
if
(
process
.
env
.
NODE_ENV
!==
'development'
)
window
.
__lib
=
require
(
'path'
).
join
(
__dirname
,
`../../../../
${
require
(
'../config/index.js'
).
DllFolder
}
`
).
replace
(
/
\\
/g
,
'\\\\'
)
</script>
<
% } %>
...
...
src/renderer/components/LandingPage.vue
查看文件 @
043788d
...
...
@@ -73,9 +73,11 @@ export default {
],
dialogVisible: false,
progressStaus: null,
filePath: ""
filePath: ""
,
}),
created() {},
created() {
console.log(__lib)
},
methods: {
// 获取electron方法
open() {
...
...
src/renderer/components/LandingPage/SystemInformation.vue
查看文件 @
043788d
...
...
@@ -26,6 +26,10 @@
<div class="name">所运行的系统:</div>
<div class="value">{{ platform }}</div>
</div>
<div class="item">
<div class="name">所运行的系统:</div>
<div class="value">{{ arch }}位</div>
</div>
</div>
</div>
</template>
...
...
@@ -39,6 +43,7 @@
node: process.versions.node,
path: this.$route.path,
platform: require('os').platform(),
arch:require('os').arch(),
vue: require('vue/package.json').version
}
},
...
...
请
注册
或
登录
后发表评论