Skip to content

Commit

Permalink
feat: update vue-echarts, add build for git page script
Browse files Browse the repository at this point in the history
  • Loading branch information
yugasun committed Nov 16, 2018
1 parent 0850499 commit e2939bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin')

const env = require('../config/prod.env')

const buildForGitPage = process.env.GIT_PAGE;

const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
Expand Down Expand Up @@ -66,6 +68,7 @@ const webpackConfig = merge(baseWebpackConfig, {
inject: false,
favicon: path.join(__dirname, '../favicon.ico'),
title: 'x-chart',
gitPage: buildForGitPage,
minify: {
removeComments: true,
collapseWhitespace: true,
Expand Down
5 changes: 3 additions & 2 deletions index.cache.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</div>
<script>
<% var resources = [];
var prefix = htmlWebpackPlugin.options.gitPage ? '/x-chart' : '';
var keys = ["manifest", "vendor", "app"];
var dependecies = [
0,
Expand All @@ -28,7 +29,7 @@
* Add prefix '/x-chart' just for gh-pages deployment,
* For your own project remove it.
*/
url: '/x-chart' + htmlWebpackPlugin.files.css[css],
url: prefix + htmlWebpackPlugin.files.css[css],
key: 'style',
});
}
Expand All @@ -41,7 +42,7 @@
* Add prefix '/x-chart' just for gh-pages deployment,
* For your own project remove it.
*/
url: '/x-chart' + htmlWebpackPlugin.files.chunks[chunk].entry,
url: prefix + htmlWebpackPlugin.files.chunks[chunk].entry,
key: keys[i],
dependencies: dependecies[i] || [],
});
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js",
"build:git-page": "GIT_PAGE=true node build/build.js",
"build:report": "npm run build --report",
"lint": "eslint --ext .js,.vue src",
"deploy": "gh-pages -d dist --remote origin",
Expand All @@ -20,7 +21,7 @@
"normalize.css": "^8.0.0",
"vue": "^2.5.16",
"vue-axios-plugin": "^1.3.0",
"vue-echarts": "https://github.com/yugasun/vue-echarts#pro/compass",
"vue-echarts": "^3.1.3",
"vue-grid-layout": "https://github.com/yugasun/vue-grid-layout#pro/compass",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
Expand Down
1 change: 0 additions & 1 deletion src/views/index/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
:ref="item.i"
:style="gridItemBackground(item.chart_type, colorStart, colorEnd)"
dragIgnoreFrom=".echarts,.x-number,.card-title,.right-buttons"
@init="initEvent"
@resized="resizedEvent"
@moved="movedEvent"
class="chart-item"
Expand Down

0 comments on commit e2939bb

Please sign in to comment.