1

I am in the process of creating a Gutenberg block that can display animations created with the JavaScript library createjs. I used the @wordpress/create-block package to create the block and was able to include the createjs library during initialization like this..

function pau_createjs_register_scripts(){
    wp_register_script( 'createjs', 'https://code.createjs.com/1.0.0/createjs.min.js');
    wp_enqueue_script( 'createjs' );
}
add_action( 'wp_enqueue_scripts', 'pau_createjs_register_scripts' );

This works great in the render.php file for the Gutenberg block, and when I view a Post or Page containing a createjs block, the animation plays. However, the CreateJS library is not included on the page in the Editor interface. How do I fix this?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.