Skip to content

Commit 4a6b53c

Browse files
committed
refactor
1 parent 594836a commit 4a6b53c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2925
-308
lines changed

.electron-vue/webpack.renderer.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ process.env.BABEL_ENV = 'renderer'
55
const path = require('path')
66
const { dependencies } = require('../package.json')
77
const webpack = require('webpack')
8+
const config = require('../config/index.js')
89

910
const BabiliWebpackPlugin = require('babili-webpack-plugin')
1011
const CopyWebpackPlugin = require('copy-webpack-plugin')
@@ -74,8 +75,17 @@ let rendererConfig = {
7475
}
7576
}
7677
},
78+
{
79+
test: /\.svg$/,
80+
loader: 'svg-sprite-loader',
81+
include: [path.join(__dirname, '../src/renderer/icons')],
82+
options: {
83+
symbolId: 'icon-[name]'
84+
}
85+
},
7786
{
7887
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
88+
exclude: [path.join(__dirname, '../src/renderer/icons')],
7989
use: {
8090
loader: 'url-loader',
8191
query: {
@@ -110,6 +120,9 @@ let rendererConfig = {
110120
},
111121
plugins: [
112122
new ExtractTextPlugin('styles.css'),
123+
new webpack.DefinePlugin({
124+
'process.env': config.dev.env
125+
}),
113126
new HtmlWebpackPlugin({
114127
filename: 'index.html',
115128
template: path.resolve(__dirname, '../src/index.ejs'),

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ dist/electron/*
33
dist/web/*
44
build/*
55
!build/icons
6+
package-lock.json
67
node_modules/
78
npm-debug.log
89
npm-debug.log.*

README.md

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# my-project
1+
# electron-vue-admin
22

33
> An electron-vue project
44
5-
#### Build Setup
5+
This is a vue electron admin project base on [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template) , and was generated from [electron-vue](https://github.com/SimulatedGREG/electron-vue) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about this project can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).
6+
7+
## Build Setup
68

79
``` bash
810
# install dependencies
@@ -11,15 +13,20 @@ npm install
1113
# serve with hot reload at localhost:9080
1214
npm run dev
1315

14-
# build electron application for production
16+
# build electron app for production
1517
npm run build
1618

17-
18-
# lint all JS/Vue component files in `src/`
19+
# lint all JS/Vue component files in `app/src`
1920
npm run lint
2021

22+
# run webpack in production
23+
npm run pack
2124
```
22-
2325
---
2426

25-
This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue)@[7c4e3e9](https://github.com/SimulatedGREG/electron-vue/tree/7c4e3e90a772bd4c27d2dd4790f61f09bae0fcef) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).
27+
28+
## Demo
29+
30+
![](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/electron-login.png)
31+
32+
![](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/electron-admin.gif)

config/dev.env.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
NODE_ENV: '"development"',
3+
BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"'
4+
}

config/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
build: {
3+
env: require('./prod.env')
4+
},
5+
dev: {
6+
env: require('./dev.env')
7+
}
8+
}

config/prod.env.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
NODE_ENV: '"production"',
3+
BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"'
4+
}

0 commit comments

Comments
 (0)