浏览代码

Make sure to fail early.

Piotrek Koszuliński 9 年之前
父节点
当前提交
e070bcb380
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      dev/tasks/bundle/tasks.js

+ 8 - 4
dev/tasks/bundle/tasks.js

@@ -97,22 +97,26 @@ module.exports = ( config ) => {
 							presets: [ 'es2015-rollup' ]
 						} )
 					]
-				} ).then( ( bundle ) => {
+				} )
+				.then( ( bundle ) => {
 					return bundle.write( {
 						dest: outputFile,
 						format: 'iife',
 						moduleName: config.moduleName
 					} );
-				} ).then( () => {
+				} )
+				.then( () => {
 					// If everything went well then remove tmp directory.
 					utils.clean( bundleTmpDir, path.join( '' ) );
-				} ).catch( ( err ) => {
+				} )
+				.catch( ( err ) => {
 					// If something went wrong then log error.
-					gutil.log( gutil.colors.red( `Bundle Error` ) );
 					gutil.log( gutil.colors.red( err.stack ) );
 
 					// And remove tmp directory.
 					utils.clean( bundleTmpDir, path.join( '' ) );
+
+					throw new Error( 'Build error.' );
 				} );
 			}