From ae37c6b57c47b70da0d89e635f64258cfbe91b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Wed, 25 Dec 2019 16:11:16 -0300 Subject: [PATCH] Fix vendor extracted js modules not available in editor. Fixes #2370 --- app/setup.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/setup.php b/app/setup.php index d5ca9ba33e..bfe1b3a535 100755 --- a/app/setup.php +++ b/app/setup.php @@ -36,14 +36,15 @@ */ add_action('enqueue_block_editor_assets', function () { if ($manifest = asset('scripts/manifest.asset.php')->get()) { + wp_enqueue_script('sage/vendor.js', asset('scripts/vendor.js')->uri(), ['jquery'], null, true); wp_enqueue_script( 'sage/editor.js', asset('scripts/editor.js')->uri(), - $manifest['dependencies'], + array_merge($manifest['dependencies'], ['sage/vendor.js']), $manifest['version'] ); - wp_add_inline_script('sage/editor.js', asset('scripts/manifest.js')->contents(), 'before'); + wp_add_inline_script('sage/vendor.js', asset('scripts/manifest.js')->contents(), 'before'); } wp_enqueue_style('sage/editor.css', asset('styles/editor.css')->uri(), false, null);