and then plugins: ['gjs-plugin-export'], can it be achieved by import or require ?","dateCreated":"2018-01-15T22:34:24Z","upvoteCount":0,"author":{"@type":"Person","name":"goldengrisha","url":"https://github.com/goldengrisha"},"url":"https://github.com/GrapesJS/grapesjs/issues/762#issuecomment-357804257"},{"@type":"Answer","text":"You mean something like this?!?","dateCreated":"2018-01-16T12:49:55Z","upvoteCount":0,"author":{"@type":"Person","name":"artf","url":"https://github.com/artf"},"url":"https://github.com/GrapesJS/grapesjs/issues/762#issuecomment-357949791"}]}}
Issue #762💬 AnsweredOpened January 15, 2018by goldengrisha0 reactions

Require

快速解答by austinbiggs

@goldengrisha - Can you clarify exactly what you're trying to achieve?

Read full answer below ↓

Question

Please help, how can I require or import grapesjs-blocks-basic, not through <script/> tag?

Answers (3)

austinbiggsJanuary 16, 2018

@goldengrisha - Can you clarify exactly what you're trying to achieve?

goldengrishaJanuary 16, 2018

for example if I want to include this plugin I need to add tag like this <script src="path/to/grapesjs-plugin-export.min.js"></script> and then plugins: ['gjs-plugin-export'], can it be achieved by import or require ?

artfJanuary 16, 2018

You mean something like this?!?

import grapesjs from 'grapesjs';
import 'grapesjs-blocks-basic'; // <-- autoloads inside grapesjs instance

const editor = grapesjs.init({
	// ...
	plugins: ['gjs-blocks-basic'],
});

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.