Do you know that CKEditor 5 provides an online builder? If you want to add specific features, you can easily do so by visiting this link
Since CKEditor is entirely written in JavaScript, maintenance in Node(NPM) is a simple task.
To create a CKEditor plugin, all you have to do is select the desired features and install them using npm install. After that, build it manually with Webpack.
For convenience, CKEditor offers an online builder where you can choose the Editor type and features you desire, then proceed with a custom build.
You will be able to download the Custom build, and the structure will resemble the image below:
https://i.sstatic.net/L1yjE.png
The ckeditor.js file you are looking for can be found in the build folder, as per your question's requirements.
If you need, refer to the Src folder to locate CKEditor.js, containing all installed plugin configurations.
// Sample code
// Additions from CKEditor Online Builder
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor.js';
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat.js';
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote.js';
import Code from '@ckeditor/ckeditor5-basic-styles/src/code.js';
import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock.js';
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials.js';
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph.js';
import Table from '@ckeditor/ckeditor5-table/src/table.js';
class Editor extends ClassicEditor {}
// Plugins included in the build.
Editor.builtinPlugins = [
Autoformat,
BlockQuote,
Code,
CodeBlock,
Essentials,
Paragraph,
Table
];
export default Editor;
Below is the Webpack Configuration file:
// Example of Webpack Configuration
'use strict';
/* eslint-env node */
const path = require( 'path' );
const webpack = require( 'webpack' );
const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' );
const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
const TerserWebpackPlugin = require( 'terser-webpack-plugin' );
module.exports = {
devtool: 'source-map',
performance: { hints: false },
entry: path.resolve( __dirname, 'src', 'ckeditor.js' ),
output: {
library: 'ClassicEditor',
path: path.resolve( __dirname, 'build' ),
filename: 'ckeditor.js',
libraryTarget: 'umd',
libraryExport: 'default'
},
optimization: {
minimizer: [
new TerserWebpackPlugin( {
sourceMap: true,
terserOptions: {
output: {
comments: /^!/
}
},
extractComments: false
} )
]
},
// Additional settings and plugins...
};
If you wish to add extra features, simply use the online builder or install them via npm and modify CKEditor.js in the src file. Then, execute the following command to build the Webpack file: "npx webpack --config webpack.config.js"
Prior to running this command, remember to install webpack and all necessary npm modules.