From 730ba7850375208266e9f083fe699f7b7b34b262 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Tue, 8 Nov 2022 16:05:43 +0200 Subject: [PATCH] Update applying-styles-with-stylesheets.md --- .../applying-styles-with-stylesheets.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md b/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md index 800f7dddd57f67..815adfdf80c26d 100644 --- a/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md +++ b/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md @@ -160,6 +160,37 @@ registerBlockType( 'gutenberg-examples/example-02-stylesheets', { {% end %} +### Build or add dependency + +In order to include the blockEditor as a dependancy, make sure to run the build step, or update the asset php file. + +{% codetabs %} +{% JSX %} + +Build the scripts and update the asset file which is used to keep track of dependencies and the build version. +```bash +npm run build +``` + +{% Plain %} + +Edit the asset file to include the block-editor dependancy for the scripts. + +```php + + array( + 'wp-blocks', + 'wp-element', + 'wp-block-editor', + 'wp-polyfill' + ), + 'version' => '0.1' + ); +``` + +{% end %} + ### Enqueue stylesheets Like scripts, you can enqueue your block's styles using the `block.json` file.