WordPress / gutenberg-examples

Examples for extending WordPress/Gutenberg with blocks.
1.2k stars 315 forks source link

made npm start and npm run build to include all blocks by default #256

Closed juanmaguitar closed 1 year ago

juanmaguitar commented 1 year ago

When activating "Gutenberg Examples" after running npm start the following error appears

Screenshot 2023-08-27 at 18 54 48
Plugin could not be activated because it triggered a fatal error.

Warning: require(/var/www/html/wp-content/plugins/gutenberg-examples/build/non-block-examples/07-slotfills-esnext/index.php): Failed to open stream: No such file or directory in /var/www/html/wp-content/plugins/gutenberg-examples/index.php on line 26

Fatal error: Uncaught Error: Failed opening required '/var/www/html/wp-content/plugins/gutenberg-examples/build/non-block-examples/07-slotfills-esnext/index.php' (include_path='.:') in /var/www/html/wp-content/plugins/gutenberg-examples/index.php:26 Stack trace: #0 /var/www/html/wp-admin/includes/plugin.php(2318): include_once() #1 /var/www/html/wp-admin/plugins.php(192): plugin_sandbox_scrape('gutenberg-examp...') #2 {main} thrown in /var/www/html/wp-content/plugins/gutenberg-examples/index.php on line 26

This is due the fact that npm start only run the build of the blocks-jsx and not the non-block-examples which are also called from build folder at index.php

This PR solves this by making npm start and npm run build to generate the build of all blocks that require build