Explorar el Código

Split config to two files. The first contains parameters for build, the second - for the editor.

Kamil Piechaczek hace 8 años
padre
commit
332a560d24

+ 3 - 4
packages/ckeditor5-build-classic/bin/build.js

@@ -11,17 +11,16 @@ const path = require( 'path' );
 const webpack = require( 'webpack' );
 const { logger, bundler } = require( '@ckeditor/ckeditor5-dev-utils' );
 const webpackUtils = require( '@ckeditor/ckeditor5-dev-webpack-utils' );
-const buildConfig = require( '../build-config' );
+const buildConfig = require( '../config-build' );
 const log = logger();
 const entryPoint = 'ckeditor.js';
 
 log.info( 'Creating an entry file...' );
 
-bundler.createEntryFile( entryPoint, {
+bundler.createEntryFile( entryPoint, './config-editor', {
 	plugins: buildConfig.plugins,
 	moduleName: buildConfig.moduleName,
-	editor: buildConfig.editor,
-	config: buildConfig.editorConfig,
+	editor: buildConfig.editor
 } );
 
 const packageRoot = path.join( __dirname, '..' );

+ 1 - 14
packages/ckeditor5-build-classic/build-config.js

@@ -25,18 +25,5 @@ module.exports = {
 		'@ckeditor/ckeditor5-typing/src/typing',
 		'@ckeditor/ckeditor5-undo/src/undo',
 	],
-	moduleName: 'ClassicEditor',
-	editorConfig: {
-		toolbar: [
-			'headings',
-			'bold',
-			'italic',
-			'link',
-			'unlink',
-			'bulletedList',
-			'numberedList',
-			'undo',
-			'redo'
-		]
-	}
+	moduleName: 'ClassicEditor'
 };

+ 20 - 0
packages/ckeditor5-build-classic/config-editor.js

@@ -0,0 +1,20 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+'use strict';
+
+module.exports = {
+	toolbar: [
+		'headings',
+		'bold',
+		'italic',
+		'link',
+		'unlink',
+		'bulletedList',
+		'numberedList',
+		'undo',
+		'redo'
+	]
+};