Procházet zdrojové kódy

We'll need to handle errors manually, since plumber fails when using other stream libraries (which are not affected by it's monkey patches).

Piotrek Koszuliński před 10 roky
rodič
revize
99544850cd
3 změnil soubory, kde provedl 6 přidání a 23 odebrání
  1. 5 4
      dev/tasks/gulp/build.js
  2. 1 18
      dev/tasks/gulp/utils.js
  3. 0 1
      package.json

+ 5 - 4
dev/tasks/gulp/build.js

@@ -25,6 +25,7 @@ const gulp = require( 'gulp' );
 const del = require( 'del' );
 const merge = require( 'merge-stream' );
 const gulpMirror = require( 'gulp-mirror' );
+const gulpWatch = require( 'gulp-watch' );
 const gutil = require( 'gulp-util' );
 const minimist = require( 'minimist' );
 const utils = require( './utils' );
@@ -63,7 +64,7 @@ module.exports = ( config ) => {
 				const glob = path.join( config.ROOT_DIR, 'ckeditor.js' );
 
 				return gulp.src( glob )
-					.pipe( watch ? utils.watch( glob ) : utils.noop() );
+					.pipe( watch ? gulpWatch( glob ) : utils.noop() );
 			},
 
 			/**
@@ -76,7 +77,7 @@ module.exports = ( config ) => {
 				const glob = path.join( config.ROOT_DIR, 'src', '**', '*.js' );
 
 				return gulp.src( glob )
-					.pipe( watch ? utils.watch( glob ) : utils.noop() )
+					.pipe( watch ? gulpWatch( glob ) : utils.noop() )
 					.pipe( utils.wrapCKEditor5Module() );
 			},
 
@@ -119,7 +120,7 @@ module.exports = ( config ) => {
 					const opts = { base: baseDir };
 
 					return gulp.src( glob, opts )
-						.pipe( watch ? utils.watch( glob, opts ) : utils.noop() );
+						.pipe( watch ? gulpWatch( glob, opts ) : utils.noop() );
 				} );
 
 				return merge.apply( null, streams )
@@ -143,4 +144,4 @@ module.exports = ( config ) => {
 	} );
 
 	return tasks;
-};
+};

+ 1 - 18
dev/tasks/gulp/utils.js

@@ -6,8 +6,6 @@ const path = require( 'path' );
 const gulp = require( 'gulp' );
 const rename = require( 'gulp-rename' );
 const babel = require( 'gulp-babel' );
-const gulpWatch = require( 'gulp-watch' );
-const gulpPlumber = require( 'gulp-plumber' );
 const gutil = require( 'gulp-util' );
 const multipipe = require( 'multipipe' );
 const PassThrough = require( 'stream' ).PassThrough;
@@ -22,21 +20,6 @@ const utils = {
 		return new PassThrough( { objectMode: true } );
 	},
 
-	/**
-	 * Transforms a stream of files into a watched stream of files.
-	 *
-	 * @param {String} glob The glob pattern to watch.
-	 * @param {Object} opts Gulp watcher opts.
-	 * @returns {Stream}
-	 */
-	watch( glob, opts ) {
-		return multipipe(
-			// Note: we're using plumber only when watching. In other cases we should fail quickly and loudly.
-			gulpPlumber(),
-			gulpWatch( glob, opts )
-		);
-	},
-
 	/**
 	 * Saves the files piped into this stream to the `dist/` directory.
 	 *
@@ -186,4 +169,4 @@ const utils = {
 	}
 };
 
-module.exports = utils;
+module.exports = utils;

+ 0 - 1
package.json

@@ -31,7 +31,6 @@
     "gulp": "^3.9.0",
     "gulp-babel": "^6.1.0",
     "gulp-mirror": "^0.4.0",
-    "gulp-plumber": "^1.0.1",
     "gulp-rename": "^1.2.2",
     "gulp-sourcemaps": "^1.6.0",
     "gulp-util": "^3.0.7",