Forráskód Böngészése

Aligned gulpfile to the bundler-rollup changes.

Maciek 9 éve
szülő
commit
12ee83e5ba
3 módosított fájl, 49 hozzáadás és 56 törlés
  1. 33 0
      build-config.js
  2. 0 30
      dev/bundles/build-config-standard.js
  3. 16 26
      gulpfile.js

+ 33 - 0
build-config.js

@@ -0,0 +1,33 @@
+/* jshint browser: false, node: true, strict: true */
+'use strict';
+
+module.exports = {
+	// Name of CKEditor instance exposed as global variable by a bundle.
+	moduleName: 'ClassicEditor',
+
+	// Specify path where bundled editor will be saved.
+	destinationPath: './build/dist/',
+
+	editor: 'editor-classic/classic',
+
+	rollupOptions: {
+		// List of plugins.
+		plugins: [
+			'autoformat',
+			'basic-styles/bold',
+			'basic-styles/italic',
+			'clipboard',
+			'enter',
+			'heading',
+			'image',
+			'link',
+			'list',
+			'paragraph',
+			'typing',
+			'undo'
+		],
+
+		// The format of the generated bundle.
+		format: 'iife',
+	}
+};

+ 0 - 30
dev/bundles/build-config-standard.js

@@ -1,30 +0,0 @@
-'use strict';
-
-module.exports = {
-	// Name of CKEditor instance exposed as global variable by a bundle.
-	moduleName: 'ClassicEditor',
-
-	// Specify path where bundled editor will be saved.
-	path: '.',
-
-	editor: 'editor-classic/classic',
-
-	// List of plugins.
-	plugins: [
-		'autoformat',
-		'basic-styles/bold',
-		'basic-styles/italic',
-		'clipboard',
-		'enter',
-		'heading',
-		'image',
-		'link',
-		'list',
-		'paragraph',
-		'typing',
-		'undo'
-	],
-
-	// The format of the generated bundle.
-	format: 'iife'
-};

+ 16 - 26
gulpfile.js

@@ -126,34 +126,24 @@ 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 ) ),
+
+		ROOT_DIR: config.ROOT_DIR,
+		MODULE_DIR: config.MODULE_DIR,
+	};
+}
 
 // Documentation. -------------------------------------------------------------