@nuxtjs/component-cache
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/nuxt/modules/compare/@nuxtjs/component-cache@1.0.0...@nuxtjs/component-cache@1.1.0) (2017-08-17) | ||
### Features | ||
* **component-cache:** update for 1.0 compatibility ([447b4cc](https://github.com/nuxt/modules/commit/447b4cc)) | ||
<a name="0.1.4"></a> | ||
@@ -8,0 +19,0 @@ ## [0.1.4](https://github.com/nuxt/modules/compare/@nuxtjs/component-cache@0.1.3...@nuxtjs/component-cache@0.1.4) (2017-06-06) |
14
index.js
const LRU = require('lru-cache') | ||
module.exports = function nuxtComponentCache(options) { | ||
if (this.options.build.ssr === false) { | ||
module.exports = function nuxtComponentCache (options) { | ||
if (this.options.render.ssr === false) { | ||
// SSR Disabled | ||
@@ -9,13 +9,13 @@ return | ||
// Create placeholder | ||
if (typeof this.options.build.ssr !== 'object' || this.options.build.ssr === null) { | ||
this.options.build.ssr = {} | ||
// Create empty bundleRenderer object if not defined | ||
if (typeof this.options.render.bundleRenderer !== 'object' || this.options.render.bundleRenderer === null) { | ||
this.options.render.bundleRenderer = {} | ||
} | ||
// Disable if cache explicitly provided in project | ||
if (this.options.build.ssr.cache) { | ||
if (this.options.render.bundleRenderer.cache) { | ||
return | ||
} | ||
this.options.build.ssr.cache = LRU(Object.assign({ | ||
this.options.render.bundleRenderer.cache = LRU(Object.assign({ | ||
max: 10000, | ||
@@ -22,0 +22,0 @@ maxAge: 1000 * 60 * 15 |
{ | ||
"name": "@nuxtjs/component-cache", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
4108