How to add external dependencies to a custom block?
-
I’m building a custom Gutenberg block with this starter template – https://www.npmjs.com/package/@wordpress/create-block. It will be using Highcharts library to render a chart on both front and back end.
Question: I already have a CDN version of Highcharts script registered and enqueued in functions.php because it’s being used elsewhere in the theme – can I use that same script as a dependency in my block?
Problem: If I add Highcharts script using “import” in edit.js, it prompts me to install the NPM package, and if I do, it gets bundled into my block script, which I am trying to avoid.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to add external dependencies to a custom block?’ is closed to new replies.