Hi,
I'm trying to enable the SimpleUploadAdapter
plugin in this build.
The SimpleUploadAdapter guide states:
"The @ckeditor/ckeditor5-upload package is available by default in all official editor builds. You do not have to install it, if you are extending one."
I imported the ClassicEditor
class like this:
import ClassicEditor from '@ckeditor/ckeditor5-build-classic/build/ckeditor';
And this is working correctly; I can setup an editor in page with the following code:
document.addEventListener("DOMContentLoaded", () => {
let editors = document.querySelectorAll('.ckeditor');
for (let editor of editors) {
window.ClassicEditor.create(editor)
.catch(error => {
console.error(error);
});
}
});
However, I am struggling to import the SimpleUploadAdapter
class.
Adding the line
import SimpleUploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter';
as suggested in the guide obviously fails, as I have no ckeditor5-upload
in my node-modules; installing it and requiring the corresponding file obviously fails, telling me I'm adding an already bundled module to an existing build.
If the SimpleUploadAdapter
is already bundled, how can I require it?
Thanks in advance, kind regards.
If you'd like to enable SimpleUploadAdapter
, you have to create a custom build which will include this plugin. Please, see our Installing plugins guide. After enabling it in your build, you should configure it.
Ok, guess I'll implement a custom adapter. Having to create a custom build to use the simple adapter kinda defies the purpose of the simple adapter, IMHO. Thank you!
Having to create a custom build to use the simple adapter kinda defies the purpose of the simple adapter, IMHO
Thanks for the feedback. We're aware that the current solution for adding plugins to existing builds isn't convenient, but we're going to improve it.
Right now, the only way for adding plugins (and SimpleUploadAdapter
is a plugin) is described in guides mentioned in my previous posts.
Most helpful comment
Ok, guess I'll implement a custom adapter. Having to create a custom build to use the simple adapter kinda defies the purpose of the simple adapter, IMHO. Thank you!