Skip to content

Commit

Permalink
fix:代码压缩异常
Browse files Browse the repository at this point in the history
fix:目录结构
  • Loading branch information
willnewii committed Jul 9, 2017
1 parent d84a6cf commit 481f0a4
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 145 deletions.
26 changes: 2 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,7 @@
## Build Setup

``` bash
# install dependencies
cd app
npm install

--fix--
修改 app/node_modules/qiniu/node_modules/sync-request/package.json 入口文件为./browser.js
加入一行
"main": "./browser.js"
--fix--

cd ..
cnpm install //electron 需要的文件下载巨慢,经常卡死 这里推荐用cnpm
npm i //electron 需要的文件下载巨慢,经常卡死,耐心,不行就翻墙

# serve with hot reload at localhost:9080
npm run dev
Expand All @@ -46,18 +35,7 @@ npm run pack
More information can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/docs/npm_scripts.html).


#### issue
- vue package.json
```
"main": "dist/vue.common.js",
```

- sync-request package.json
```
"main": "./browser.js"
```

##### iView + Electron [独立构建-vs-运行时构建](https://cn.vuejs.org/v2/guide/installation.html#独立构建-vs-运行时构建)
##### tips: iView + Electron [独立构建-vs-运行时构建](https://cn.vuejs.org/v2/guide/installation.html#独立构建-vs-运行时构建)
```
TypeError: _vue2.default.compile is not a function at VueComponent.compile
//官网提示可以在webpack添加
Expand Down
1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "./dist/main.js",
"dependencies": {
"axios": "^0.16.1",
"electron-json-storage": "^3.0.6",
"iview": "^2.0.0-rc.18",
"moment": "^2.18.1",
"qiniu": "^7.0.4",
Expand Down
30 changes: 0 additions & 30 deletions app/src/renderer/components/LandingPageView.vue

This file was deleted.

33 changes: 0 additions & 33 deletions app/src/renderer/components/LandingPageView/CurrentPage.vue

This file was deleted.

25 changes: 0 additions & 25 deletions app/src/renderer/components/LandingPageView/Links.vue

This file was deleted.

18 changes: 0 additions & 18 deletions app/src/renderer/components/LandingPageView/Versions.vue

This file was deleted.

Binary file not shown.
12 changes: 7 additions & 5 deletions app/src/renderer/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Vue from 'vue'

import Router from 'vue-router'
import Electron from 'vue-electron'

import App from './App'
import routes from './routes'
import store from './vuex/store'
import axios from 'axios';

import iView from 'iview';
import 'iview/dist/styles/iview.css';
Expand All @@ -14,14 +13,16 @@ Vue.use(Router);
Vue.use(iView);
Vue.config.debug = false;

import routes from './routes'
import store from './vuex/store'

const router = new Router({
scrollBehavior: () => ({y: 0}),
routes
});

//拦截器
import axios from 'axios';

axios.interceptors.response.use((response) => {
return response;
}, (error) => {
Expand All @@ -30,7 +31,8 @@ axios.interceptors.response.use((response) => {
}
});

/* eslint-disable no-new */
import App from './App';
/!* eslint-disable no-new *!/
new Vue({
router,
store,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
import * as types from '../vuex/mutation-types'
import storage from 'electron-json-storage'
import RightContent from './Main/RightContent.vue'
import RightContent from '../components/Main/RightContent.vue'
import api from '../api/API'
let API = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</template>

<script>
import ClientHeader from './Main/ClientHeader.vue'
import ClientHeader from '../components/Main/ClientHeader.vue'
import {mapGetters, mapActions} from 'vuex'
import * as types from '../vuex/mutation-types'
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions app/src/renderer/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default [
{
path: '/',
name: 'main',
component: require('components/Main.vue'),
component: require('pages/Main.vue'),
children: [
{
path: 'table',
Expand All @@ -12,18 +12,18 @@ export default [
{
path: 'setup',
name: 'setup',
component: require('components/Setup.vue')
component: require('pages/Setup.vue')
}
]
},
{
path: '/login',
name: 'login',
component: require('components/SetToken.vue')
component: require('pages/Login.vue')
},
{
path: '/tray',
name: 'tray',
component: require('components/Tray.vue')
component: require('pages/Tray.vue')
}
]
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"webpack-dev-server": "^2.3.0"
},
"dependencies": {
"electron-json-storage": "^3.0.4",
"node-notifier": "^5.1.2"
}
}
7 changes: 4 additions & 3 deletions webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,12 @@ let rendererConfig = {
libraryTarget: 'commonjs2',
path: path.join(__dirname, 'app/dist')
},
externals: Object.keys(pkg.dependencies || {}).filter(d => !['vue', 'iview'].includes(d)),
externals: Object.keys(pkg.dependencies || {}).filter(d => !['vue'].includes(d)),
resolve: {
alias: {
'vue$': path.join(__dirname, 'app/node_modules/vue/dist/vue.esm.js'),
'components': path.join(__dirname, 'app/src/renderer/components'),
'pages': path.join(__dirname, 'app/src/renderer/pages'),
'renderer': path.join(__dirname, 'app/src/renderer')
},
extensions: ['.js', '.vue', '.json', '.css', '.node']
Expand All @@ -123,12 +124,12 @@ if (process.env.NODE_ENV === 'production') {
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})/*,
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})*/
})
)
}

Expand Down

0 comments on commit 481f0a4

Please sign in to comment.