Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Commit

Permalink
compression gzip
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonxiang committed May 24, 2017
1 parent 7be2ce0 commit 0fa4df1
Show file tree
Hide file tree
Showing 43 changed files with 55 additions and 84 deletions.
9 changes: 9 additions & 0 deletions build/deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var path = require('path')
var shell = require('shelljs')

var sourcePath = path.resolve(__dirname, '../www/*')
var targetPath = path.resolve(__dirname, '../../../deploy/website')

shell.rm('-rf', targetPath+'/*')
shell.mkdir('-p', targetPath)
shell.cp('-R', sourcePath, targetPath)
3 changes: 3 additions & 0 deletions build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var webpackConfig = merge(baseWebpackConfig, {
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
comments: false,
compress: {
warnings: false
},
Expand Down Expand Up @@ -95,6 +96,8 @@ var webpackConfig = merge(baseWebpackConfig, {
]
})


console.log(config.build.productionGzip)
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')

Expand Down
4 changes: 2 additions & 2 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ module.exports = {
index: path.resolve(__dirname, '../www/index.html'),
assetsRoot: path.resolve(__dirname, '../www'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
assetsPublicPath: '/website/',
productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzip: true,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
"scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js"
"build": "node build/build.js",
"deploy": "node build/deploy.js",
"analyz": "npm run build --report"
},
"dependencies": {
"axios": "^0.16.1",
"fastclick": "^1.0.6",
"jsonp": "^0.2.1",
"leaflet": "^1.0.2",
"leaflet": "^1.0.3",
"leaflet.locatecontrol": "^0.60.0",
"object-assign": "^4.1.1",
"vue": "^2.3.3",
"vue-meta": "^0.5.6",
"vue-router": "^2.5.3",
"vueleaflet": "^2.0.12",
"vueleaflet": "^2.1.0",
"vuex": "^2.3.1",
"vuex-i18n": "^1.3.4",
"vuex-router-sync": "^4.1.2",
Expand All @@ -34,6 +36,7 @@
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^1.1.3",
"compression-webpack-plugin": "^0.4.0",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
Expand All @@ -50,7 +53,7 @@
"ora": "^1.2.0",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"shelljs": "^0.7.7",
"sw-precache-webpack-plugin": "^0.9.2",
"url-loader": "^0.5.8",
"vue-loader": "^11.3.4",
Expand Down
2 changes: 1 addition & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ const routes = [
]


const router = new VueRouter({mode:'history', routes })
const router = new VueRouter({mode:'history',base:'/website/', routes })

export default router
2 changes: 1 addition & 1 deletion src/views/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
</script>

<style>
@import "~leaflet/dist/leaflet.css";
@import "https://cdn.bootcss.com/leaflet/1.0.3/leaflet.css";
@import "~leaflet.locatecontrol/dist/L.Control.Locate.css";
@import "//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css";
Expand Down
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><title></title><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><link href=./static/css/app.43f3598378dc29afd295289edca29048.css rel=stylesheet></head><body ontouchstart><div id=app></div><script type=text/javascript src=./static/js/manifest.3c89dab460961facc5de.js></script><script type=text/javascript src=./static/js/vendor.f6377a11a892075cc9be.js></script><script type=text/javascript src=./static/js/app.cb9eb7853df1efe63c95.js></script></body></html>
<!DOCTYPE html><html><head><title></title><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><link href=/website/static/css/app.43f3598378dc29afd295289edca29048.css rel=stylesheet></head><body ontouchstart><div id=app></div><script type=text/javascript src=/website/static/js/manifest.8fb155717fb789aa885d.js></script><script type=text/javascript src=/website/static/js/vendor.4e975408029123c47979.js></script><script type=text/javascript src=/website/static/js/app.288911c71140c447fcb5.js></script></body></html>
2 changes: 1 addition & 1 deletion www/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/* eslint-disable indent, no-unused-vars, no-multiple-empty-lines, max-nested-callbacks, space-before-function-paren, quotes, comma-spacing */
'use strict';

var precacheConfig = [["./static/blog.json","a1c0284232f6565df6cbbdd794b2c3f2"],["./static/css/app.43f3598378dc29afd295289edca29048.css","cdb7a1d4baa1387318ed59fb687bfe4b"],["./static/img/qrcode.4c602f0.jpg","4c602f01a62e56e4851fa9b2b47e37b8"],["./static/js/0.ac4df46b5f5b6919a7d3.js","c50df4a27e3f8d621fbe087230110224"],["./static/js/1.9113d8d7d82b4c7e3db7.js","e891879c40c87a3f5c49fb96135957d6"],["./static/js/2.66a01449a58fc76097cc.js","71b4eda9d074fe394b4394839241e929"],["./static/js/3.9701290b11837c057258.js","4cb588ef08748362e528a857beb4db8d"],["./static/js/4.e3c67b7be5379da55455.js","fb7765c0a9cb8749e64d879e6588e379"],["./static/js/5.c34a32d098f119aa383f.js","d5fff229096e0f60c224a21f1de20358"],["./static/js/6.449ae9303c55bf45325f.js","af32a3f07e1cdb84c5feea4470bf13a2"],["./static/js/app.cb9eb7853df1efe63c95.js","3086f0a98a0f73812b33065500b8f028"],["./static/js/manifest.3c89dab460961facc5de.js","d2407d24ddbac5d6dd0cf2cd7000e8fc"],["./static/js/vendor.f6377a11a892075cc9be.js","acf303bf6b909d8797ec7f7da540b0a9"]];
var precacheConfig = [["/website/static/blog.json","a1c0284232f6565df6cbbdd794b2c3f2"],["/website/static/css/app.43f3598378dc29afd295289edca29048.css","cdb7a1d4baa1387318ed59fb687bfe4b"],["/website/static/img/qrcode.4c602f0.jpg","4c602f01a62e56e4851fa9b2b47e37b8"],["/website/static/js/0.c17306009549cf240204.js","2add77a32977f1edeb3264719ab2b6a9"],["/website/static/js/0.c17306009549cf240204.js.gz","43be6e1664cc8ce7566e12b1874c285d"],["/website/static/js/1.2e358a5942f061b0ec70.js","c2d23343e73b690669e8079322eaa6cc"],["/website/static/js/1.2e358a5942f061b0ec70.js.gz","7c7fbd0a8382c252fa968826e3294981"],["/website/static/js/2.de5d8035487a7bdcb741.js","aab6c1889323a515cd7e7617eb55e8a7"],["/website/static/js/2.de5d8035487a7bdcb741.js.gz","ed98fe2bb54fd2814932bc48a64d06f2"],["/website/static/js/3.04cd1cb45abe92eac04b.js","227d43d63e06fe56703f64140a2e87ac"],["/website/static/js/3.04cd1cb45abe92eac04b.js.gz","990c7bcca342049cb5e442b2cdee6de6"],["/website/static/js/4.866b0a6abf621eea0eae.js","74057312a7ef94ac0de207c564598095"],["/website/static/js/4.866b0a6abf621eea0eae.js.gz","ae575016580dadf172346a3c28ad0013"],["/website/static/js/5.35fe033d422245d43932.js","578a64f83411c25c47a0e7e760a7ee00"],["/website/static/js/5.35fe033d422245d43932.js.gz","67bba689018157db806acd4d23455a45"],["/website/static/js/6.bd7c5253732f22bd797a.js","09eb852d46dc8371cb3dc7f490f2c873"],["/website/static/js/6.bd7c5253732f22bd797a.js.gz","7bae32c8e03e232a86723f57c2b8036a"],["/website/static/js/app.288911c71140c447fcb5.js","a2aaa1226f071a61e2278b4ab4be72df"],["/website/static/js/app.288911c71140c447fcb5.js.gz","7c7f6f232dbaf3ed90bdaca0d6c4c131"],["/website/static/js/manifest.8fb155717fb789aa885d.js","fdad21dd9fef88cc519afd8cded5d124"],["/website/static/js/vendor.4e975408029123c47979.js","471f37f0c40cd3f167c0ad7370a194aa"],["/website/static/js/vendor.4e975408029123c47979.js.gz","cbd8fe944b60701875cb2cd54858010a"]];
var cacheName = 'sw-precache-v3-vue-hn-' + (self.registration ? self.registration.scope : '');


Expand Down

Large diffs are not rendered by default.

Binary file added www/static/js/0.c17306009549cf240204.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file added www/static/js/1.2e358a5942f061b0ec70.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file added www/static/js/2.de5d8035487a7bdcb741.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file added www/static/js/3.04cd1cb45abe92eac04b.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file added www/static/js/4.866b0a6abf621eea0eae.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file added www/static/js/5.35fe033d422245d43932.js.gz
Binary file not shown.

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions www/static/js/5.c34a32d098f119aa383f.js

This file was deleted.

1 change: 0 additions & 1 deletion www/static/js/5.c34a32d098f119aa383f.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions www/static/js/6.bd7c5253732f22bd797a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added www/static/js/6.bd7c5253732f22bd797a.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions www/static/js/6.bd7c5253732f22bd797a.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions www/static/js/app.288911c71140c447fcb5.js

Large diffs are not rendered by default.

Binary file added www/static/js/app.288911c71140c447fcb5.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions www/static/js/app.288911c71140c447fcb5.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions www/static/js/app.cb9eb7853df1efe63c95.js

This file was deleted.

1 change: 0 additions & 1 deletion www/static/js/app.cb9eb7853df1efe63c95.js.map

This file was deleted.

Loading

0 comments on commit 0fa4df1

Please sign in to comment.