0

I have something like the following:

<script src="js/jquery.js">
<script src="js/bootstrap.js">
<script src="js/featured-news.js" data-container-id="news1">
<script src="js/featured-news.js" data-container-id="news2">

I'd like the jquery and bootstrap scripts to be combine into something like:

<script src="js/jquery.js+bootstrap.js.pagespeed.jc.FTvtsO6TBe.js"></script>

But I'd like the script tags with data-* attributes to be left alone. So the end result might look like:

<script src="js/jquery.js+bootstrap.js.pagespeed.jc.FTvtsO7TBe.js"></script>
<script src="js/featured-news.js" data-container-id="news1">
<script src="js/featured-news.js" data-container-id="news2">

I'd still like the contents of these files to be minified though. How would I configure pagespeed to do this? Will combine_javascript module acknowledge that both these script tags have data-* attributes and merging them might cause issues?

Martyn
  • 91
  • 2
  • 11
  • can you explain your ultimate end goal? in other words : do you want your pages to load faster in browsers? or you're looking for something else. – John R Mar 28 '22 at 03:33
  • if you need a smaller version of jquery, I made one : https://github.com/jintor/stubquery.js – John R Mar 28 '22 at 03:34

0 Answers0