• Resolved sannin

    (@sannin)


    The javascript file the plugins uses is ~180Kbs, which is quite bad for core vitals. If you add the woocommerce addon, you have another ~180Kbs.

    Is it possible to reduce the size of the files, and combine the core js with the woocommerce one?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi Sannin,

    The file sizes are admittedly large, but as we are using the algolia instant search and autocomplete libraries – it is unavoidable at the moment – we are looking into alternatives to see how to make it better, but there isn’t a quick fix.

    If you are only using the instant search for WooCommerce shop and not autocomplete or instant search for the base plugin then you can dequeue the script for the base plugin with the following code.

    
    add_action('wp_print_scripts','cm_07072022_dequeue_scripts');
    function cm_07072022_dequeue_scripts(){
    	wp_dequeue_script('cm-typesense-frontend');
    	wp_deregister_script('cm-typesense-frontend');
    }
    

    However – please keep in mind this will disable the base plugins functionality.
    Hope this helps.

    Thread Starter sannin

    (@sannin)

    So the js file of woocommerce addons just adds the instant search functionality?

    If i just use the autocomplete, can i safely remove it?

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi Sannin,
    Are you replacing WordPress search with Typesense search ? Or are you replacing WooCommerce search with Typesense WC Search ?

    If it’s the first – then yes you can safely remove WooCommerce js files.
    If it’s the second – you would need to replace SWT js files.

    I hope that makes sense.
    All in all – please do test before implementing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Javascript Files Size’ is closed to new replies.