Ckeditor5: Request: How do I use plugins in non-npm environments

Created on 17 Dec 2018  ·  5Comments  ·  Source: ckeditor/ckeditor5

Is this a bug report or feature request? (choose one)

🆕 Feature request

💻 Version of CKEditor

latest

📋 Steps to reproduce

For example:
image
I want to use this plugin, but I do not want to build it into my project, I hope I can use them from CDN, like ckeditor.js:
https://cdn.ckeditor.com/ckeditor5/11.2.0/classic/ckeditor.js
If u provide ckeditor CDN link, why not provide all plugins?

✅ Expected result

I hope I can load plugin from CDN

❎ Actual result

I didn't find any way.

📃 Other details that might be useful

nop

duplicate

Most helpful comment

Just build a bundle and download it with the online builder: https://ckeditor.com/ckeditor-5/online-builder/

All 5 comments

Unfortunately, it's impossible. Check out the Installing plugins guide, especially:

One of the possible mistakes is trying to add a plugin in this way to an existing (bundled) editor build. Installing an existing build and then trying to add a plugin to it may not work if that plugin needs to import any of the source editor modules.
The reason why this method will not work is that dependencies of the added plugin may duplicate the code already bundled in the used editor build. In the best scenario, this is going to raise the overall code size. In the worst scenario, an application built this way may be unstable.

CKEditor 5 is an ultra–modular framework. The classes delivered by the ckeditor5-upload package use other classes and utilities of the framework. They import them at the very beginning of their files. If you use a plugin (classes) with an editor build made by webpack (like ckeditor5-build-classic) those imports make no longer sense (how to resolve them?). Only standalone (import–less) features can be added that way to the build.

You should create an editor build if you want to add extra plugins. Besides, the classes of ckeditor5-upload are available in all ready–to–use editor builds we provide. Maybe your editor already has them? (e.g. try editor.plugins.get( 'FileRepository' )).

Also, see https://github.com/ckeditor/ckeditor5/issues/1047#issuecomment-393068327 and https://github.com/ckeditor/ckeditor5/issues/1237.

Thanks for reply

but the editor build is not having the Font plugin. I just want to add font plugin, I am in a pure html and Jquery environment cannot use npm.

Just build a bundle and download it with the online builder: https://ckeditor.com/ckeditor-5/online-builder/

Just build a bundle and download it with the online builder: https://ckeditor.com/ckeditor-5/online-builder/
@olitomas
I bundled and downloaded but you are still left with a having to use ES6 modules
image

Was this page helpful?
0 / 5 - 0 ratings