Tagged: Minify
- AuthorPosts
- June 16, 2023 at 9:43 am #92442Dan GGuest
I’m getting an error due to minify, where I used “Non-blocking using defer”.
The error is “ReferenceError: wp is not defined” on the line wp.i18n.setLocaleData.Long story short, I’m trying to exclude files in /wp-includes/js/dist because I suspect that there’s a tree of dependencies with WP js files.
I’m trying to add the following to “Never minify the following JS files” (with regex enabled):
wp-includes\/js\/dist\/.*
But that doesn’t seem to work.
Can you help?
Thank you!
June 16, 2023 at 9:48 am #92617Marko VasiljevicKeymasterHello Dan,
Thank you for reaching out and I am happy to assist you with this.
In W3 Total Cache, Excluding JS Files From Minify does work. However, as you can see in the description:
Always ignore the specified JS files. Use relative paths.
So you should add one path per line, for example:
/wp-includes/js/jquery/jquery.min.js
/wp-includes/js/jquery/jquery-migrate.min.js
You cannot use regex to exclude multiple files in the same directory.
Once added, make sure to save all settings and purge the cache.I hope this helps!
Thanks!
June 19, 2023 at 9:13 am #92894Dan GGuestOh, I see. I didn’t get that intent from the description when I first read it.
Thanks! - AuthorPosts
- The topic ‘Excluding JS files from minify doesn’t work’ is closed to new replies.