disable auto minification

cmirea4all
New Member
1 0 5

Hi, 

Shopify is now giving back minified version: 

https://shopify.dev/changelog/shopify-now-serves-minified-javascript-files-automatically 

For development purposes I would like to have the non-minified version for specific javascripts files.

Also, this behavior sometime is breaking some scripts (vue apps) 

Do we  have query parameter or global settings to receive un-minified version? 

 

 

 

Replies 4 (4)
thepig
Tourist
3 1 1

I agree.  This is posing a real pain for debugging some JS changes I need to make.

PaulNewton
Shopify Partner
4211 303 902

@cmirea4all  , @thepig 

Because shopify loves to makes these things like completely  backwards non obvious and more complicated than it needs to be: If you make a file with "min" in it's name the auto-minification doesn't mangle code.

 

So theme.js > minified , workflow disrupted

theme.min.js > unminified , no post processing , workflow restored

 

 

That's right to get an uniminified source while working on a theme you have to put unminified sources in a file named as if it's minified.Other sane expectations do not work to turn off post-processing of resources like enable_js_minification=0 , or a complementary  disable_js_minification , using raw in the name or as a parameter or as a path with assets /assets/raw.

Or at least recognizing that a debugger statement shouldn't be stripped out.

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
whiteoctopuswd
Tourist
9 0 3

The solution worked for me! Brilliant find! Thank you PaulNewton!!

PurpleMamba
Shopify Partner
113 2 15

Ha! Thanks @PaulNewton