diff --git a/index.js b/index.js index 509f03d..9382968 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ try { } // map object storing rollup cache objects for each input file -var rollupCache = new Map +var rollupCache = {} function parseBundles(arg) { if (typeof arg == 'string') @@ -65,7 +65,7 @@ class GulpRollup extends Transform { // caching is enabled by default because of the nature of gulp and the watching/recompilatin // but can be disabled by setting 'cache' to false if (inputOptions.cache !== false) - inputOptions.cache = rollupCache.get(inputOptions.input) + inputOptions.cache = rollupCache[inputOptions.input] || null // enable sourcemap is gulp-sourcemaps plugin is enabled var createSourceMap = file.sourceMap !== undefined @@ -162,7 +162,7 @@ class GulpRollup extends Transform { .then(bundle => { // cache rollup object if caching is enabled if (inputOptions.cache !== false) - rollupCache.set(inputOptions.input, bundle) + rollupCache[inputOptions.input] = bundle // generate ouput according to (each of) given outputOptions return Promise.all(bundleList.map((outputOptions, i) => createBundle(bundle, outputOptions, i))) }) @@ -170,7 +170,7 @@ class GulpRollup extends Transform { .then(() => cb(null, file)) .catch(err => { if (inputOptions.cache !== false) - rollupCache.delete(inputOptions.input) + rollupCache[inputOptions.input] = null process.nextTick(() => { this.emit('error', new PluginError(PLUGIN_NAME, err)) cb(null, file) diff --git a/package.json b/package.json index e25c2b3..fbab3a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-better-rollup", - "version": "4.0.0", + "version": "4.0.1", "description": "Better Gulp plugin for Rollup ES6 module bundler", "author": "Mike Kovarik", "license": "MIT",