Closed Ni55aN closed 5 years ago
Where can I find code or working example for this?
@Ni55aN Thanks for your quick response. I checked the code and example. But what I am implementing is by using html and Nodejs. So when I added https://cdn.jsdelivr.net/npm/rete-dock-plugin@0.1.1/build/dock-plugin.common.min.js to my html file, I am getting error ReferenceError: exports in not defined.
This minified bundle by JsDelivr has CommonJs format (for Node.js, not browser). You need a UMD - this one
Then you must use it as follows:
editor.use(DockPlugin.default, ...
By the way, I always advise to use ES modules if you have the opportunity to use a bundler. UMDs are only useful when you want to use it on Codepen, for example
@Ni55aN Thanks for your inputs. But what I am trying to do here is, I am building a drupal 8 module and I don't want to have a dependency of Nodejs for that module. So when someone will use that module it should be just easy enabling that module and it should work. Do you think this could have some problem?
Do you think this could have some problem?
Its harder to manage dependencies in this way. In addition, UMD modules have polyfills, which leads to an increase in the size of each bundle by about 5 KB