🎉 Discount Alert! Get 50% OFF our premium products license renewal or new purchase - Offer Ends Soon!

Open the terminal window and write the following command to install the WordPress blocks package.

Install npm Package

npm i @wordpress/blocks

Install WordPress Blocks Package

Import-Package To JavaScript Code

Write the following code to your index.js file. You need to add the import code before calling the function.

import {registerBlockType} from "@wordpress/blocks"

 

Import WordPress block to your JS code

 

You only need this npm package to compile all JavaScript and SCSS files. This npm package does not support older versions of Node and npm. Please check the node and npm versions before running this command. You must install Node.js 14.0.0 or later and npm 6.14.4 or later on your computer to run the scripts.

Last Update: August 7, 2023
August 7, 2023 446 Mahbub Alam KhanGeneral, WordPress
Total 0 Votes
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Back To Top
Premium WordPress Themes and Plugins By xenioushk
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.