Ju99ernaut / grapesjs-component-code-editor

Code editor for grapesjs
MIT License
64 stars 21 forks source link

Not Recognized as plugin #9

Closed devtechk closed 3 years ago

devtechk commented 3 years ago

Hi, I'm using angular I've implemented yet the gjs-preset-webpage and I'd like to add the grapesjs-component-code-editor and the postcss but they're not recognized.

imported like this: import 'grapesjs-parser-postcss'; import 'grapesjs-component-code-editor';

Used: plugins: ['gjs-preset-webpage', 'grapesjs-parser-postcss', 'grapesjs-component-code-editor', driveForcePlugin],

Screenshot attached.

Hope you can help me. Thanks

image

Ju99ernaut commented 3 years ago

Importing should be something like this:

// ...
import grapesjs from 'grapesjs';
import codeEditor from 'grapesjs-component-code-editor';
import parserPostCSS from 'grapesjs-parser-postcss';
import 'grapesjs-component-code-editor/dist/grapesjs-component-code-editor.min.css';

const editor = grapesjs.init({
  container : '#gjs',
  // ...
  plugins: [
    editor => codeEditor(editor, { /* options */ }),
    parserPostCSS,
  ],
  // ...
});
// ...
devtechk commented 3 years ago

Thank you,This morning I've tried in a similar way and it worked. I'll try your way too!