Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen committed May 3, 2018
1 parent 594836a commit 4a6b53c
Show file tree
Hide file tree
Showing 61 changed files with 2,925 additions and 308 deletions.
13 changes: 13 additions & 0 deletions .electron-vue/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ process.env.BABEL_ENV = 'renderer'
const path = require('path')
const { dependencies } = require('../package.json')
const webpack = require('webpack')
const config = require('../config/index.js')

const BabiliWebpackPlugin = require('babili-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
Expand Down Expand Up @@ -74,8 +75,17 @@ let rendererConfig = {
}
}
},
{
test: /\.svg$/,
loader: 'svg-sprite-loader',
include: [path.join(__dirname, '../src/renderer/icons')],
options: {
symbolId: 'icon-[name]'
}
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
exclude: [path.join(__dirname, '../src/renderer/icons')],
use: {
loader: 'url-loader',
query: {
Expand Down Expand Up @@ -110,6 +120,9 @@ let rendererConfig = {
},
plugins: [
new ExtractTextPlugin('styles.css'),
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
new HtmlWebpackPlugin({
filename: 'index.html',
template: path.resolve(__dirname, '../src/index.ejs'),
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist/electron/*
dist/web/*
build/*
!build/icons
package-lock.json
node_modules/
npm-debug.log
npm-debug.log.*
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# my-project
# electron-vue-admin

> An electron-vue project
#### Build Setup
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).

## Build Setup

``` bash
# install dependencies
Expand All @@ -11,15 +13,20 @@ npm install
# serve with hot reload at localhost:9080
npm run dev

# build electron application for production
# build electron app for production
npm run build


# lint all JS/Vue component files in `src/`
# lint all JS/Vue component files in `app/src`
npm run lint

# run webpack in production
npm run pack
```

---

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).

## Demo

![](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/electron-login.png)

![](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/electron-admin.gif)
4 changes: 4 additions & 0 deletions config/dev.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
NODE_ENV: '"development"',
BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"'
}
8 changes: 8 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
build: {
env: require('./prod.env')
},
dev: {
env: require('./dev.env')
}
}
4 changes: 4 additions & 0 deletions config/prod.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
NODE_ENV: '"production"',
BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"'
}
Loading

0 comments on commit 4a6b53c

Please sign in to comment.