ckeditor / ckeditor5-angular

Official CKEditor 5 Angular 5+ component.
https://ckeditor.com/ckeditor-5
Other
202 stars 110 forks source link

Can't add plugin made with Package Generator #402

Open piernik opened 7 months ago

piernik commented 7 months ago

I'm trying to add plugin that is created with Package Generator

It is clean plugin generated with dll:build command. What next? If I import it like import LukanaPlugin from '../../../../../../../../libsJs/ckeditor5-lukana/build/lukana.js';

I get error while console.log(LukanaPlugin): ReferenceError: CKEditor5 is not defined

also tried import {LukanaPlugin} import * as LukanaPlugin. Always the same error.

How to import dll plugins in angular? Or how to export them in Package Generator?

Witoso commented 7 months ago

How to import dll plugins in angular?

Make sure that your app includes the main DLL build, without it, the plugin will not work:

<!-- Base DLL build in plain HTML -->
<!-- Note: It includes ckeditor5-paragraph too. -->
<script src="path/to/node_modules/ckeditor5/build/ckeditor5-dll.js"></script>

Could you share more info about your setup?

piernik commented 7 months ago

I want to import it in Angular App. There should not be script tags.

Witoso commented 7 months ago

First, you need to import our base DLL:

import ckeditor5Dll from "ckeditor5/build/ckeditor5-dll.js";

and then your plugin. Maybe our DLL Strapi integration could serve as a reference, although it's not in Angular.