'ai-bot', 'scripts' => [ 'wp-blocks', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', ], ]; $loaded_dev_assets = Asset_Loader\enqueue_assets( $dev_manifest, $opts ); if ( ! $loaded_dev_assets ) { // Production mode. Manually enqueue script bundles. if ( file_exists( $plugin_path . 'build/editor.js' ) ) { $plugin_data = get_option( 'ai_bot_settings_option_name' ); $plugin_data['settings_page'] = admin_url( 'options-general.php?page=aibot-settings' ); wp_enqueue_script( $opts['handle'], $plugin_url . 'build/editor.js', $opts['scripts'], filemtime( $plugin_path . 'build/editor.js' ), true ); wp_localize_script( $opts['handle'], 'aibot', $plugin_data ); } // TODO: Error if file is not found. if ( file_exists( $plugin_path . 'build/editor.css' ) ) { wp_enqueue_style( $opts['handle'], $plugin_url . 'build/editor.css', null, filemtime( $plugin_path . 'build/editor.css' ) ); } } }