front compression

This commit is contained in:
long2ice
2020-04-26 21:19:46 +08:00
parent ded661b68b
commit 49c7bc0df0
4 changed files with 134 additions and 3 deletions

111
front/package-lock.json generated
View File

@@ -3471,6 +3471,117 @@
}
}
},
"compression-webpack-plugin": {
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/compression-webpack-plugin/download/compression-webpack-plugin-3.1.0.tgz",
"integrity": "sha1-n1EBcqe1+uWq07ZwZS6L15l67so=",
"dev": true,
"requires": {
"cacache": "^13.0.1",
"find-cache-dir": "^3.0.0",
"neo-async": "^2.5.0",
"schema-utils": "^2.6.1",
"serialize-javascript": "^2.1.2",
"webpack-sources": "^1.0.1"
},
"dependencies": {
"cacache": {
"version": "13.0.1",
"resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz?cache=0&sync_timestamp=1585010507538&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcacache%2Fdownload%2Fcacache-13.0.1.tgz",
"integrity": "sha1-qAAMIWlwiQgvhSh6GuxuOCAkpxw=",
"dev": true,
"requires": {
"chownr": "^1.1.2",
"figgy-pudding": "^3.5.1",
"fs-minipass": "^2.0.0",
"glob": "^7.1.4",
"graceful-fs": "^4.2.2",
"infer-owner": "^1.0.4",
"lru-cache": "^5.1.1",
"minipass": "^3.0.0",
"minipass-collect": "^1.0.2",
"minipass-flush": "^1.0.5",
"minipass-pipeline": "^1.2.2",
"mkdirp": "^0.5.1",
"move-concurrently": "^1.0.1",
"p-map": "^3.0.0",
"promise-inflight": "^1.0.1",
"rimraf": "^2.7.1",
"ssri": "^7.0.0",
"unique-filename": "^1.1.1"
}
},
"find-cache-dir": {
"version": "3.3.1",
"resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz?cache=0&sync_timestamp=1583734806517&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-cache-dir%2Fdownload%2Ffind-cache-dir-3.3.1.tgz",
"integrity": "sha1-ibM/rUpGcNqpT4Vff74x1thP6IA=",
"dev": true,
"requires": {
"commondir": "^1.0.1",
"make-dir": "^3.0.2",
"pkg-dir": "^4.1.0"
}
},
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz",
"integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz",
"integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
},
"make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz?cache=0&sync_timestamp=1587567693680&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmake-dir%2Fdownload%2Fmake-dir-3.1.0.tgz",
"integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=",
"dev": true,
"requires": {
"semver": "^6.0.0"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz",
"integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
}
},
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz",
"integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=",
"dev": true
},
"pkg-dir": {
"version": "4.2.0",
"resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz",
"integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=",
"dev": true,
"requires": {
"find-up": "^4.0.0"
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz",
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=",
"dev": true
}
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz",

View File

@@ -42,6 +42,7 @@
"@vue/cli-plugin-eslint": "^4.0.5",
"@vue/cli-service": "^4.0.5",
"babel-eslint": "^10.0.3",
"compression-webpack-plugin": "^3.1.0",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"express": "^5.0.0-alpha.7",

View File

@@ -1,3 +1,5 @@
const CompressionPlugin = require('compression-webpack-plugin');
module.exports = {
runtimeCompiler: true,
productionSourceMap: false,
@@ -13,5 +15,10 @@ module.exports = {
}
}
},
}
chainWebpack(config) {
config.plugins.delete('prefetch');
// and this line
config.plugin('CompressionPlugin').use(CompressionPlugin);
}
}

View File

@@ -2439,6 +2439,18 @@ compressible@~2.0.16:
dependencies:
mime-db ">= 1.43.0 < 2"
compression-webpack-plugin@^3.1.0:
version "3.1.0"
resolved "https://registry.npm.taobao.org/compression-webpack-plugin/download/compression-webpack-plugin-3.1.0.tgz#9f510172a7b5fae5aad3b670652e8bd7997aeeca"
integrity sha1-n1EBcqe1+uWq07ZwZS6L15l67so=
dependencies:
cacache "^13.0.1"
find-cache-dir "^3.0.0"
neo-async "^2.5.0"
schema-utils "^2.6.1"
serialize-javascript "^2.1.2"
webpack-sources "^1.0.1"
compression@^1.7.4:
version "1.7.4"
resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f"
@@ -8851,7 +8863,7 @@ webpack-merge@^4.2.2:
dependencies:
lodash "^4.17.15"
webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3:
webpack-sources@^1.0.1, webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933"
integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==