Removes '-components' from bundle files names and 'user-' from search and admin bundles.

This commit is contained in:
Mateus Machado Luna 2020-01-13 13:47:07 -03:00
parent 48f89126ca
commit 167a93c75d
4 changed files with 22 additions and 22 deletions

View File

@ -103,7 +103,7 @@ class Admin {
global $TAINACAN_BASE_URL;
wp_enqueue_script( 'tainacan-roles', $TAINACAN_BASE_URL . '/assets/roles-components.js', ['underscore', 'wp-i18n'], TAINACAN_VERSION, true );
wp_enqueue_script( 'tainacan-roles', $TAINACAN_BASE_URL . '/assets/roles.js', ['underscore', 'wp-i18n'], TAINACAN_VERSION, true );
$settings = $this->get_admin_js_localization_params();
wp_localize_script( 'tainacan-roles', 'tainacan_plugin', $settings );
@ -163,11 +163,11 @@ class Admin {
function add_admin_js() {
global $TAINACAN_BASE_URL;
wp_enqueue_script( 'tainacan-user-admin', $TAINACAN_BASE_URL . '/assets/user_admin-components.js', ['underscore', 'media-editor', 'media-views', 'customize-controls'], TAINACAN_VERSION, true );
wp_enqueue_script( 'tainacan-admin', $TAINACAN_BASE_URL . '/assets/admin.js', ['underscore', 'media-editor', 'media-views', 'customize-controls'], TAINACAN_VERSION, true );
$settings = $this->get_admin_js_localization_params();
wp_localize_script( 'tainacan-user-admin', 'tainacan_plugin', $settings );
wp_localize_script( 'tainacan-admin', 'tainacan_plugin', $settings );
wp_enqueue_media();
wp_enqueue_script('underscore');
wp_enqueue_script('jcrop');

View File

@ -46,7 +46,7 @@ function tainacan_blocks_register_tainacan_terms_list(){
wp_register_script(
'terms-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_terms_list-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_terms_list.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor', 'underscore')
);
@ -69,13 +69,13 @@ function tainacan_blocks_register_tainacan_facets_list(){
wp_enqueue_script(
'facets-list-theme',
$TAINACAN_BASE_URL . '/assets/gutenberg_facets_list_theme-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_facets_list_theme.js',
array('wp-components')
);
wp_register_script(
'facets-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_facets_list-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_facets_list.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
@ -99,7 +99,7 @@ function tainacan_blocks_register_tainacan_items_list(){
wp_register_script(
'items-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_items_list-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_items_list.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
@ -122,13 +122,13 @@ function tainacan_blocks_register_tainacan_dynamic_items_list(){
wp_enqueue_script(
'dynamic-items-list-theme',
$TAINACAN_BASE_URL . '/assets/gutenberg_dynamic_items_list_theme-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_dynamic_items_list_theme.js',
array('wp-components')
);
wp_register_script(
'dynamic-items-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_dynamic_items_list-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_dynamic_items_list.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
@ -152,13 +152,13 @@ function tainacan_blocks_register_tainacan_carousel_items_list(){
wp_enqueue_script(
'carousel-items-list-theme',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_items_list_theme-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_items_list_theme.js',
array('wp-components')
);
wp_register_script(
'carousel-items-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_items_list-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_items_list.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
@ -182,13 +182,13 @@ function tainacan_blocks_register_tainacan_carousel_terms_list(){
wp_enqueue_script(
'carousel-terms-list-theme',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_terms_list_theme-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_terms_list_theme.js',
array('wp-components')
);
wp_register_script(
'carousel-terms-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_terms_list-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_terms_list.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
@ -212,13 +212,13 @@ function tainacan_blocks_register_tainacan_search_bar(){
wp_enqueue_script(
'search-bar-theme-script',
$TAINACAN_BASE_URL . '/assets/gutenberg_search_bar_script-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_search_bar_script.js',
array('wp-components')
);
wp_register_script(
'search-bar',
$TAINACAN_BASE_URL . '/assets/gutenberg_search_bar-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_search_bar.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
@ -241,7 +241,7 @@ function tainacan_blocks_register_tainacan_collections_list(){
wp_register_script(
'collections-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_collections_list-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_collections_list.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
@ -264,13 +264,13 @@ function tainacan_blocks_register_tainacan_carousel_collections_list(){
wp_enqueue_script(
'carousel-collections-list-theme',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_collections_list_theme-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_collections_list_theme.js',
array('wp-components')
);
wp_register_script(
'carousel-collections-list',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_collections_list-components.js',
$TAINACAN_BASE_URL . '/assets/gutenberg_carousel_collections_list.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);

View File

@ -105,7 +105,7 @@ class Theme_Helper {
global $TAINACAN_BASE_URL;
if ( $force || is_post_type_archive( \Tainacan\Repositories\Repository::get_collections_db_identifiers() ) || tainacan_get_term() || get_query_var('tainacan_repository_archive') == 1 ) {
//\Tainacan\Admin::get_instance()->add_admin_js();
wp_enqueue_script('tainacan-search', $TAINACAN_BASE_URL . '/assets/user_search-components.js' , [] , TAINACAN_VERSION, true);
wp_enqueue_script('tainacan-search', $TAINACAN_BASE_URL . '/assets/search.js' , [] , TAINACAN_VERSION, true);
wp_localize_script('tainacan-search', 'tainacan_plugin', \Tainacan\Admin::get_instance()->get_admin_js_localization_params());
}
}

View File

@ -5,8 +5,8 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
module.exports = {
entry: {
user_search: './src/admin/js/theme-main.js',
user_admin: './src/admin/js/main.js',
search: './src/admin/js/theme-main.js',
admin: './src/admin/js/main.js',
roles: './src/admin/js/roles-main.js',
gutenberg_terms_list: './src/gutenberg-blocks/tainacan-terms/terms-list/index.js',
@ -37,7 +37,7 @@ module.exports = {
output: {
path: path.resolve(__dirname, './src/assets/'),
publicPath: './src/assets/',
filename: '[name]-components.js'
filename: '[name].js'
},
module: {
rules: [