From 65606a156a411c9041770800f27aff3234bc6d03 Mon Sep 17 00:00:00 2001 From: Timothy Jacobs Date: Wed, 9 May 2018 11:16:31 -0400 Subject: [PATCH] Remove unnecessary script dependencies. These dependencies aren't necessary. The `wp-blocks` style previously held the styles for core blocks, which the built styles do not depend on. It was also removed in the latest Gutenberg version. The editor dependencies are always enqueued before the editor assets. Fixes #55 --- packages/cgb-scripts/template/src/init.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cgb-scripts/template/src/init.php b/packages/cgb-scripts/template/src/init.php index 3edb775f..467ea695 100644 --- a/packages/cgb-scripts/template/src/init.php +++ b/packages/cgb-scripts/template/src/init.php @@ -25,7 +25,7 @@ function <% blockNamePHPLower %>_cgb_block_assets() { wp_enqueue_style( '<% blockNamePHPLower %>-cgb-style-css', // Handle. plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS. - array( 'wp-blocks' ) // Dependency to include the CSS after it. + array() // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: filemtime — Gets file modification time. ); } // End function <% blockNamePHPLower %>_cgb_block_assets(). @@ -47,7 +47,7 @@ function <% blockNamePHPLower %>_cgb_editor_assets() { wp_enqueue_script( '<% blockNamePHPLower %>-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. - array( 'wp-blocks', 'wp-i18n', 'wp-element' ), // Dependencies, defined above. + array(), // Dependencies, defined above. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time. true // Enqueue the script in the footer. ); @@ -56,7 +56,7 @@ function <% blockNamePHPLower %>_cgb_editor_assets() { wp_enqueue_style( '<% blockNamePHPLower %>-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. - array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. + array() // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime — Gets file modification time. ); } // End function <% blockNamePHPLower %>_cgb_editor_assets().