|
|
@@ -1,4 +1,7 @@
|
|
|
-/* jshint node: true, esnext: true */
|
|
|
+/**
|
|
|
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
|
|
|
+ * For licensing, see LICENSE.md.
|
|
|
+ */
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
@@ -132,9 +135,11 @@ module.exports = ( config ) => {
|
|
|
* The main build task which is capable of copying, watching, processing and writing all files
|
|
|
* to the `dist/` directory.
|
|
|
*
|
|
|
+ * @param {Object} buildOptions
|
|
|
+ * @param {String} buildOptions.formats
|
|
|
* @returns {Stream}
|
|
|
*/
|
|
|
- build() {
|
|
|
+ build( buildOptions ) {
|
|
|
//
|
|
|
// NOTE: Error handling in streams is hard.
|
|
|
//
|
|
|
@@ -166,7 +171,7 @@ module.exports = ( config ) => {
|
|
|
//
|
|
|
// PS. The assumption is that all errors thrown somewhere inside conversionStream are forwarded to conversionStream.
|
|
|
// Multipipe and gulp-mirror seem to work this way, so we get a single error emitter.
|
|
|
- const formats = options.formats.split( ',' );
|
|
|
+ const formats = ( buildOptions.formats || options.formats ).split( ',' );
|
|
|
const codeStream = tasks.src.all( options.watch )
|
|
|
.pipe(
|
|
|
utils.noop( ( file ) => {
|
|
|
@@ -230,5 +235,9 @@ module.exports = ( config ) => {
|
|
|
|
|
|
gulp.task( 'build', [ 'build:clean' ], tasks.build );
|
|
|
|
|
|
+ gulp.task( 'build-esnext', () => {
|
|
|
+ return tasks.build( { formats: 'esnext' } );
|
|
|
+ } );
|
|
|
+
|
|
|
return tasks;
|
|
|
};
|