The classic editor build of CKEditor 5 with Base64UploadAdapter
- Clone the build repository.
- Install the plugin package.
- Add it to the build configuration.
- Bundle the build.
Clone the build repository.
git clone -b stable https://github.com/ckeditor/ckeditor5
cd ckeditor5/packages/ckeditor5-build-classic
npm install
Now, install the plugin package:
npm install --save @ckeditor/ckeditor5-upload
Edit the src/ckeditor.js file to add your plugin to the list of plugins which will be included in the build and to add your feature’s button to the toolbar:
...
...
import Base64UploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter';
...
// Plugins to include in the build.
ClassicEditor.builtinPlugins = [
...
Base64UploadAdapter,
]
Finally, bundle the build:
npm run build
If everything worked, the editor build (which is available in the build/
directory) should be updated.
jin@death-note:~/ckeditor5-build-classic-base64-upload-adapter/build$ ls
-rw-rw-r-- 1 jin jin 719976 May 8 13:07 ckeditor.js
-rw-rw-r-- 1 jin jin 4792997 May 8 13:07 ckeditor.js.map
drwxrwxr-x 2 jin jin 4096 May 8 13:07 translations
/* Before */
//import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
/* After */
import ClassicEditor from '@/ckeditor5-build-classic-base64-upload-adapter/build/ckeditor.js';
npm install browser-image-compression
/src/modules/base64uploadAdapter.js
/src/modules/imageCompressor.js
/src/ckeditor.js