|
public function scriptLoaderTag( $tag, $handle = '', $src = '' ) { |
|
if ( $this->skipModuleTag( $handle ) ) { |
|
return $tag; |
|
} |
|
|
|
$tag = str_replace( $src, $this->normalizeAssetsHost( $src ), $tag ); |
|
|
|
// Remove the type and re-add it as module. |
|
$tag = preg_replace( '/type=[\'"].*?[\'"]/', '', (string) $tag ); |
|
$tag = preg_replace( '/<script/', '<script type="module"', (string) $tag ); |
|
|
|
return $tag; |
|
} |
We ran into an issue where Jetpack Boost's concatenate JS feature was picking up modules and concatenating them with regular scripts.
Using wp_enqueue_script_module (it was introduced last year) would help separate the type of scripts enqueued on the page.
all-in-one-seo-pack/app/Common/Traits/Assets.php
Lines 113 to 125 in c8381d3
We ran into an issue where Jetpack Boost's concatenate JS feature was picking up modules and concatenating them with regular scripts.
Using
wp_enqueue_script_module(it was introduced last year) would help separate the type of scripts enqueued on the page.