Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent CKEditor 4 from loading config.js for bundling and minification

We are creating a build process to minify and concatenate all our files.

Unfortunately, CKEditor loads config.js and styles.js by itself. I would like to concatenate all of these files together so that there's only 1 http request.

As a test, I tried to create a file that contains ckeditor.js and config.js combined together using the files from the basic download.

Unfortunately, it seems that ckeditor will still go ahead and try to load a config.js.

However, if I use the ckeditor.js hosted by ckeditor, there appears to only be 1 request: http://jsfiddle.net/jdPn3/

In the above case, config.js and styles.js does not appear to be loaded.

How are they doing the concatenation?

like image 370
F21 Avatar asked May 08 '14 00:05

F21


1 Answers

For some reason, CKEDITOR.editorConfig() is not called once CKEditor is loaded. I think it is only called when instantiating an editor.

Therefore, I had to modify the global configuration directly:

CKEDITOR.config.customConfig = false; //no config.js
CKEDITOR.config.stylesSet = false; //no styles.js
CKEDITOR.config.defaultLanguage = 'en'; //default language
CKEDITOR.config.language = 'en'; //ui language
like image 165
F21 Avatar answered Sep 27 '22 21:09

F21