|
|
@@ -126,34 +126,21 @@ gulp.task( 'compile:themes:esnext', ( callback ) => {
|
|
|
|
|
|
// Building tasks. ------------------------------------------------------------
|
|
|
|
|
|
-const ckeditor5DevBundler = require( '@ckeditor/ckeditor5-dev-bundler-rollup' )( config );
|
|
|
-
|
|
|
-gulp.task( 'build', callback => {
|
|
|
- runSequence(
|
|
|
- 'bundle:generate',
|
|
|
- [
|
|
|
- 'bundle:minify:js',
|
|
|
- 'bundle:minify:css'
|
|
|
- ],
|
|
|
- () => ckeditor5DevBundler.showSummaryFromConfig( callback )
|
|
|
- );
|
|
|
+gulp.task( 'build', () => {
|
|
|
+ const bundler = require( '@ckeditor/ckeditor5-dev-bundler-rollup' );
|
|
|
+
|
|
|
+ return bundler.tasks.build( getBuildOptions() );
|
|
|
} );
|
|
|
|
|
|
-// Helpers. ---------------------------
|
|
|
-
|
|
|
-gulp.task( 'bundle:clean', ckeditor5DevBundler.cleanFromConfig );
|
|
|
-gulp.task( 'bundle:minify:js', ckeditor5DevBundler.minify.jsFromConfig );
|
|
|
-gulp.task( 'bundle:minify:css', ckeditor5DevBundler.minify.cssFromConfig );
|
|
|
-
|
|
|
-// Generates the bundle without minifying it.
|
|
|
-gulp.task( 'bundle:generate',
|
|
|
- [
|
|
|
- 'bundle:clean',
|
|
|
- 'compile:js:esnext',
|
|
|
- 'compile:themes:esnext'
|
|
|
- ],
|
|
|
- ckeditor5DevBundler.generateFromConfig
|
|
|
-);
|
|
|
+function getBuildOptions() {
|
|
|
+ const minimist = require( 'minimist' );
|
|
|
+ const pathToConfig = minimist( process.argv.slice( 2 ) ).config || './build-config';
|
|
|
+
|
|
|
+ return {
|
|
|
+ packages: getCKEditor5PackagesPaths(),
|
|
|
+ buildConfig: require( path.resolve( '.', pathToConfig ) ),
|
|
|
+ };
|
|
|
+}
|
|
|
|
|
|
// Documentation. -------------------------------------------------------------
|
|
|
|