这是indexloc提供的服务,不要输入任何密码
Skip to content

Add support for building blocks in theme #510

@divyarajmasani

Description

@divyarajmasani

Summary

At present the theme does not have any example of how to add block in the theme itself.

This issue explores the necessary configuration and structural changes for building blocks in the theme.

Expected workflow for creating a new block in the theme:

  • Running npm run create:block creates necessary scaffolding for the block using @wordpress/create-block package.
  • On build, all necessary block files could be moved to assets/build/blocks along with built scripts and styles.
  • Add support for creating block manifest, ref. https://www.npmjs.com/package/@wordpress/scripts#build-blocks-manifest.
  • Register blocks with manifest if available.

Acceptance Criteria

  • New block can be added with a npm script.
  • New blocks are registered automatically.
  • Should be able to exclude any block from build or registration.
  • Appropriate documentation has been added to /docs

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions