In our build process (using grunt), we concatenate, minify and uglify all our scripts into a single one (also meaning a single request only).
Now CKEditor 4 seems to be
I implemented suggestions 2 and 3 from Reinmar's answer - here's how I did it:
- "Editor UI stylesheet file can be perhaps concatenated with your page's stylesheets, but you'll have to find a way to prevent editor from loading it by itself"
var swap = CKEDITOR.skin.loadPart;
CKEDITOR.skin.loadPart = function(res, callback) {
if (res == 'editor') {
console.log('Ignoring editor.css load');
callback && callback();
return;
}
swap(res, callback);
}
I then bundled editor.css
into my bundled file.
- Contents stylesheet - you can remove it even if you use framed editor, but you'll need to style contents using the fullPage feature (not recommended).
// I copied the content.css from ckeditor-dev and loaded it into contentCss.
var contentCss = 'put your css here';
var config = {
// Other things here
// ...
contentCss: contentCss
};
ckeditor.replace(element, config);
Both are done at initialization time (in my code they're in the function that calls ckeditor.replace
, as shown in 3).
These are most certianly hacks, but for my current use the optimizations enabled by these hacks are worth it.
Also, in lieu of implementing suggestion 1., I prevent other js
files from loading by setting customConfig: ''
and stylesSet: false
in the config.