• Hi,
    I’m searching for how to exclude inline external script loads in a page by script tag, I’ve tried to use different Regex in the “optimize javascript” setting of the plugin but none of them work.
    To give a little more detail, the different scripts combined into one create the following error : Identifier ‘src’ has already been declared.
    Could you let me know how to exlude an inline external script from loading or being combined with the others?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @davidmottet what kind of inline JS are you referring to? Only the inline JS associated with a handle is added to the combined list. The inline JS that is hardcoded (not enqueued via WordPress) is not appended to the list. If you can provide an URL so we can check it out, that would be the easiest way to debug this.

    Thread Starter davidmottet

    (@davidmottet)

    @gabelivan The website uses WPBakery Visual Composer as a page builder and in the page the RAW HTML block is used at add a script tag.
    Like that Asset CleanUp: CSS & JavaScript Manager sees the script on the page and puts it in the list.
    That why it is in the combination of scripts.

    Plugin Author Gabe Livan

    (@gabelivan)

    @davidmottet please make a few print screens (or just one if you think it’s enough) and share them via a service such as https://imgbb.com/ – is this happening when you view the CSS & JS manager on the front-end view or within the Dashboard when you edit a post/page or the homepage?

    Thread Starter davidmottet

    (@davidmottet)

    @gabelivan
    The problem is coming from the admin side of WordPress because I am unable to exclude a JS file from the combined/minified scripts. And the front end has a problem when this script is combined. If the script could be properly excluded, there wouldn’t be any issue.
    Here is the screenshot of the admin side where we add the inline script to the page. And then also a screenshot showing that the plugin recognizes the script and compiles it with the others.
    https://ibb.co/qx4DNTd
    https://ibb.co/BG06v6q

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Combine loaded JS’ is closed to new replies.