Package Exports
- laravel-mix-wp-blocks
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (laravel-mix-wp-blocks) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Laravel Mix WP Blocks
About
Laravel mix extension to transpile WordPress blocks.
npm install laravel-mix-wp-blocks --save-dev
yarn add -D laravel-mix-wp-blocks
Usage
require("laravel-mix-wp-blocks")
mix.block('resources/assets/scripts/blocks.js', 'scripts')
Now you have access to all dependencies using @wordpress
package import syntax. Example:
import { RichText } from '@wordpress/block-editor'
You will also find a json file accompanying each script (in your dist
dir) containing all the @wordpress
dependencies utilized by that script.
You can use that JSON file when enqueing your block in PHP to make sure your declared dependencies always match up with your actual usage.