Open cnaught opened 1 month ago
You are close to make it work as expected.
Please export the editorConfig
object from your main.js
file.
And all you have to do is:
- <script type="module" src="./ckeditor/main.js"></script>
- <script> ClassicEditor.create(document.querySelector('#editor'), editorConfig); </script>
+ <script type="module">
+ import { ClassicEditor } from 'ckeditor5';
+ import { editorConfig } from './main.js'
+
+ ClassicEditor.create( document.querySelector( '#editor' ), editorConfig );
+ </script>
Please let us know if it solves your problem.
The issue lacks the feedback we asked for two weeks. Hence, we've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.
📝 Ask a question
I would like to put the configuration in an external js file called main.js. But I would like the following line to be in my main .html page:
ClassicEditor.create(document.querySelector('#editor'), editorConfig);
As soon as I move the above line into the main .html file, it stops working. I was hoping to have the main config in a separate file, but the call to the editor within the main .html file because I use multiple instances of the editor on a single page.