Skip to content

Commit 1afd1a2

Browse files
authored
Merge stable into master
2 parents a556e55 + a44a66b commit 1afd1a2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/updating/migration-to-cdn/vanilla-js.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ const { ClassicEditor } = await loadCKEditorCloud( {
126126
} );
127127
```
128128

129+
## Migrating custom plugins
130+
131+
If you are using custom plugins, you need to first {@link tutorials/creating-simple-plugin-timestamp#adapt-this-tutorial-to-cdn adapt these to work with the CDN approach}. It will change the way imports and CSS files are handled.
132+
133+
Next, refer to the {@link getting-started/setup/loading-cdn-resources Loading CDN resources} guide to learn about using the {@link getting-started/setup/loading-cdn-resources#using-the-useckeditorcloud-function#using-the-loadckeditorcloud-function `loadCKEditorCloud`} function. This will be needed to include the custom plugin in the CDN configuration of CKEditor 5. By employing these, you can dynamically import the plugin in a way similar to this one:
134+
135+
```js
136+
plugins: {
137+
CustomPlugin: () => import('./path/to/plugin.umd.js')
138+
}
139+
```
140+
141+
If your plugin depends on core plugins already loaded via CDN, you can access them through the `window.CKEDITOR` and `window.CKEDITOR_PREMIUM_FEATURES` global variables.
142+
143+
Also, `loadCKEditorCloud` uses caching, so you can call it to dynamically load dependencies. Find more details in the options section of the {@link getting-started/setup/loading-cdn-resources#the-loadckeditorcloud-function-options Loading CDN resources} guide.
144+
129145
## Conclusion
130146

131147
Following these steps, you successfully migrated CKEditor 5 from an NPM-based installation to a CDN-based installation using Vanilla JS. This approach simplifies the setup process and can help improve the performance of your application by reducing the bundle size.

0 commit comments

Comments
 (0)