Bläddra i källkod

rollup cache saves 1s per js build

Hakim El Hattab 5 år sedan
förälder
incheckning
feb43ffdc9
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      gulpfile.js

+ 6 - 0
gulpfile.js

@@ -73,13 +73,17 @@ const rollupConfigESM = {
     ]
     ]
 };
 };
 
 
+let rollupCache;
+
 // Creates a bundle with broad browser support, exposed
 // Creates a bundle with broad browser support, exposed
 // as UMD
 // as UMD
 gulp.task('js-es5', () => {
 gulp.task('js-es5', () => {
     return rollup({
     return rollup({
+        cache: rollupCache,
         input: 'js/index.js',
         input: 'js/index.js',
         ...rollupConfig
         ...rollupConfig
     }).then( bundle => {
     }).then( bundle => {
+        rollupCache = bundle.cache;
         return bundle.write({
         return bundle.write({
             name: 'Reveal',
             name: 'Reveal',
             file: './dist/reveal.js',
             file: './dist/reveal.js',
@@ -93,9 +97,11 @@ gulp.task('js-es5', () => {
 // Creates an ES module bundle
 // Creates an ES module bundle
 gulp.task('js-es6', () => {
 gulp.task('js-es6', () => {
     return rollup({
     return rollup({
+        cache: rollupCache,
         input: 'js/index.js',
         input: 'js/index.js',
         ...rollupConfigESM
         ...rollupConfigESM
     }).then( bundle => {
     }).then( bundle => {
+        rollupCache = bundle.cache;
         return bundle.write({
         return bundle.write({
             file: './dist/reveal.esm.js',
             file: './dist/reveal.esm.js',
             format: 'es',
             format: 'es',