diff --git a/examples/cached-components/nuxt.config.js b/examples/cached-components/nuxt.config.js index 6277640bf8..9ca68847a0 100644 --- a/examples/cached-components/nuxt.config.js +++ b/examples/cached-components/nuxt.config.js @@ -1,3 +1,10 @@ module.exports = { - cache: true + build: { + ssr: { + cache: require('lru-cache')({ + max: 1000, + maxAge: 1000 * 60 * 15 + }) + } + } } diff --git a/examples/cached-components/package.json b/examples/cached-components/package.json index 05750ddc83..1e7850343b 100644 --- a/examples/cached-components/package.json +++ b/examples/cached-components/package.json @@ -1,6 +1,7 @@ { "name": "nuxt-cached-components", "dependencies": { + "lru-cache": "^4.0.2", "nuxt": "latest" }, "scripts": { diff --git a/examples/hello-world/nuxt.config.js b/examples/hello-world/nuxt.config.js new file mode 100644 index 0000000000..b35102c3b2 --- /dev/null +++ b/examples/hello-world/nuxt.config.js @@ -0,0 +1,5 @@ +module.exports = { + generate: { + minify: false + } +} \ No newline at end of file diff --git a/lib/build.js b/lib/build.js index ab9b2571b4..c98127bee7 100644 --- a/lib/build.js +++ b/lib/build.js @@ -490,16 +490,7 @@ function webpackRunServer () { function createRenderer (bundle, manifest) { // Create bundle renderer to give a fresh context for every request - let cacheConfig = false - if (this.options.cache) { - this.options.cache = (typeof this.options.cache !== 'object' ? {} : this.options.cache) - cacheConfig = require('lru-cache')(_.defaults(this.options.cache, { - max: 1000, - maxAge: 1000 * 60 * 15 - })) - } this.renderer = createBundleRenderer(bundle, Object.assign({ - cache: cacheConfig, clientManifest: manifest, runInNewContext: false, inject: false, diff --git a/lib/nuxt.js b/lib/nuxt.js index 55fcf1919a..0e5e0308f6 100644 --- a/lib/nuxt.js +++ b/lib/nuxt.js @@ -30,7 +30,6 @@ class Nuxt { layouts: {}, serverMiddleware: [], ErrorPage: null, - cache: false, loading: { color: 'black', failedColor: 'red', diff --git a/package.json b/package.json index 6119ebb401..2cdf59a97e 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "babel-preset-es2015": "^6.24.1", "babel-preset-vue-app": "^1.2.0", "chokidar": "^1.7.0", - "co": "^4.6.0", "compression": "^1.6.2", "connect": "^3.6.2", "css-loader": "^0.28.1", @@ -73,7 +72,6 @@ "html-minifier": "^3.5.0", "html-webpack-plugin": "^2.28.0", "lodash": "^4.17.4", - "lru-cache": "^4.0.2", "memory-fs": "^0.4.1", "offline-plugin": "^4.7.0", "opencollective": "^1.0.3", diff --git a/yarn.lock b/yarn.lock index 3898862a9d..2a93aa4892 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3878,7 +3878,7 @@ lru-cache@^3.2.0: dependencies: pseudomap "^1.0.1" -lru-cache@^4.0.0, lru-cache@^4.0.1, lru-cache@^4.0.2: +lru-cache@^4.0.0, lru-cache@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" dependencies: