diff --git a/package.json b/package.json index 2fab22c..20190f6 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "koa-router": "^7.2.0", "koa-static": "^3.0.0", "lodash": "^4.17.4", - "lru-cache": "^4.0.2", + "lru-cache": "^4.1.0", "markdown-it": "^8.3.1", "mkdirp": "^0.5.1", "nib": "^1.1.2", @@ -65,13 +65,13 @@ "eslint": "^3.19.0", "eslint-config-standard": "^10.2.1", "eslint-plugin-babel": "^4.1.1", - "eslint-plugin-import": "^2.4.0", + "eslint-plugin-import": "^2.3.0", "eslint-plugin-node": "^5.0.0", "eslint-plugin-promise": "^3.5.0", "eslint-plugin-standard": "^3.0.1", "eslint-plugin-vue": "^2.0.1", "extract-text-webpack-plugin": "^2.1.0", - "file-loader": "^0.11.1", + "file-loader": "^0.11.2", "html-webpack-plugin": "^2.28.0", "img-loader": "^2.0.0", "lodash-webpack-plugin": "^0.11.4", diff --git a/server/dev-tools/webpack-hot.js b/server/dev-tools/webpack-hot.js index f7f071f..81359b2 100644 --- a/server/dev-tools/webpack-hot.js +++ b/server/dev-tools/webpack-hot.js @@ -7,7 +7,7 @@ const debug = _debug('hi:webpack-hmr') export default compiler => { debug('Enable Webpack Hot Module Replacement (HMR).') - const middleware = webpackHotMiddleware(compiler) + const middleware = webpackHotMiddleware(compiler, {heartbeat: 5000}) return async function koaWebpackHMR(ctx, next) { /* eslint prefer-const: 0 */ let hasNext = await applyExpressMiddleware(middleware, ctx.req, ctx.res) diff --git a/src/plugins/http.js b/src/plugins/http.js index 8eee677..8e80c6e 100644 --- a/src/plugins/http.js +++ b/src/plugins/http.js @@ -5,14 +5,10 @@ const {prototype: proto} = Vue axios.defaults.baseURL = (__SERVER__ ? INNER_SERVER : SERVER_PREFIX) + 'api' -if (!__DEV__ || !proto._$http) { +if (!__DEV__ || !proto.hasOwnProperty('$http')) { Object.defineProperty(proto, '$http', __SERVER__ ? { get() { return this.$ssrContext.axios } } : {value: axios}) - - if (__DEV__) { - proto._$http = true - } } diff --git a/yarn.lock b/yarn.lock index d9ff8ca..5397dbd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2366,7 +2366,7 @@ eslint-plugin-html@^2.0.0: dependencies: htmlparser2 "^3.8.2" -eslint-plugin-import@^2.4.0: +eslint-plugin-import@^2.3.0: version "2.4.0" resolved "http://registry.npm.taobao.org/eslint-plugin-import/download/eslint-plugin-import-2.4.0.tgz#eb468dab7196d8a8b67fdea9223e1660f418eabb" dependencies: @@ -2627,9 +2627,9 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" -file-loader@^0.11.1: - version "0.11.1" - resolved "http://registry.npm.taobao.org/file-loader/download/file-loader-0.11.1.tgz#6b328ee1234a729e4e47d36375dd6d35c0e1db84" +file-loader@^0.11.2: + version "0.11.2" + resolved "http://registry.npm.taobao.org/file-loader/download/file-loader-0.11.2.tgz#4ff1df28af38719a6098093b88c82c71d1794a34" dependencies: loader-utils "^1.0.2" @@ -4134,13 +4134,20 @@ lru-cache@^3.2.0: dependencies: pseudomap "^1.0.1" -lru-cache@^4.0.1, lru-cache@^4.0.2: +lru-cache@^4.0.1: version "4.0.2" resolved "http://registry.npm.taobao.org/lru-cache/download/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" dependencies: pseudomap "^1.0.1" yallist "^2.0.0" +lru-cache@^4.1.0: + version "4.1.0" + resolved "http://registry.npm.taobao.org/lru-cache/download/lru-cache-4.1.0.tgz#59be49a683b8d986a939f1ca60fdb6989f4b2046" + dependencies: + pseudomap "^1.0.1" + yallist "^2.0.0" + macaddress@^0.2.8: version "0.2.8" resolved "http://registry.npm.taobao.org/macaddress/download/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12"