kubetail-org / loadjs

A tiny async loader / dependency manager for modern browsers (899 bytes)
MIT License
2.57k stars 149 forks source link

query args cause issues with native file type detection #93

Closed sherrardb closed 4 years ago

sherrardb commented 5 years ago

good day, when loading assets with query args, ie /path/to/asset.css?v=20190605

the file type is not properly detected, and we fall back to loading the asset as a script.

i do realize that a possible solution is to force the file type using the proper prefix, but i also though that this would be a simple-enough feature to add.

please have a look at sherrard:strip-query-args and let me know if you are interested and i can issue a PR.

TIA

amorey commented 5 years ago

Thanks for the suggestion! I'm a bit swamped at the moment but I'll take a look at this ASAP.

sherrardb commented 5 years ago

i completely understand. it is not at all critical.

thanks

amorey commented 4 years ago

This has been fixed in v4.0.0: https://github.com/muicss/loadjs/issues/97. Apologies for the delay.

sherrardb commented 4 years ago

no problem, especially since i just realized that i never pushed my commit to github. :-)

also, not sure if it was intentional or not, but you have a console.log() in a few of the files in this latest version.

sburton@d01:/srv/git/loadjs$ grep -RFl console.log dist/
dist/loadjs.min.js
dist/loadjs.js
dist/loadjs.umd.js
amorey commented 4 years ago

Good catch! I removed the console.log() statement and published a new version (v4.0.1).