1、克隆代码仓库
https://github.com/ckeditor/ckeditor5
2、切换到目录:\ckeditor5\packages\ckeditor5-build-classic
3、安装依赖包
npm install
4、修改代码以支持图片以Base64的方式本地上传[可选]
打开文件packages\ckeditor5-build-classic\src\ckeditor.js,添加以下代码
import Base64UploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter';//添加的
//修改后的
ClassicEditor.builtinPlugins = [
Essentials,
UploadAdapter,
Autoformat,
Bold,
Italic,
BlockQuote,
CKBox,
CKFinder,
CloudServices,
EasyImage,
Heading,
Image,
ImageCaption,
ImageStyle,
ImageToolbar,
ImageUpload,
Indent,
Link,
List,
MediaEmbed,
Paragraph,
PasteFromOffice,
PictureEditing,
Table,
TableToolbar,
TextTransformation,
Base64UploadAdapter 添加的
];
5、编译
npm run build
6、如果出现build后Ckedit编译提示包重复,无法使用ckedit。需要在注释CKFinder、EasyImage相关代码,如下:
//import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder';
//import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
... ....
//CKFinder,
//EasyImage,
参考链接: