auto-minification issue with ionify
See original GitHub issueThe github auto-minification instructions
Add “.min” to any JS/CSS file to get a minified version - if one doesn’t exist, we’ll generate it for you. All generated files come with source maps and can be easily used during development:
https://cdn.jsdelivr.net/gh/jquery/jquery@3.2.1/src/core.min.js Minifying a large file can take several seconds. However, we store all generated files in our permanent storage, so this delay only applies to the first few requests.
don’t work with these javascript files
- https://cdn.jsdelivr.net/gh/ionify/ionify@public/web.min.js
- https://cdn.jsdelivr.net/gh/ionify/ionify@public/ions/on.ion.min.js
jsdelivr returns this essentially similar message with no content for both
/**
- Minified by jsDelivr using Terser v3.14.1.
- Original file: /gh/ionify/ionify@public/web.js
- Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ //# sourceMappingURL=/sm/88df9541de928e9d732efbd81ac4471116db80dcfc4c3e43e6c56fb97f5eeecd.map
The original files each load correctly from jsdelivr without the .min.js
option and when combined via
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great points re: security & the likelihood of files already being minified if their package contained a config file. I didn’t consider that and agree that it’s probably simpler to have ionify do its own minification so I’ll look into automating that via Github.
I was, and still am excited about jsDelivr’s zero-config on-demand & persistent file minification & combination. I find those features really convenient & helpful for performance, and now expect them from top-tier cdns.
I’m still concerned about Terser’s compression operation and think it’s important to confirm why the
sequences
compress
option causes the code omission problem I’m seeing. I’ll look into that and file a Terser issue if it’s indeed a bug in their compression process.That’s rather weird, based on what that option is for, I wouldn’t expect it to make a difference in what code is dropped.
Regarding the author-defined config, I don’t think this is something we could do in the near future.
First, it’s a potential security problem and would need to be examined and implemented carefully.
Second, if a package contained the config file, it would almost always contain the minified files as well. The only exception would be if the author specifically relied on jsDelivr to generate the files but needed to change the config, as in your case. However, this is a very rare case and since author’s involvement is needed anyway, they may just ship the minified files themselves. The main point of auto minification is that’s it’s zero config and you can use it even when the author doesn’t want/care to ship the minified files.
I do think it makes sense to examine the compress option and if there’s something that might improve compatibility without significantly affecting the size, we could change it. But in your case it might just make more sense to setup a GH action to automatically minify and publish the files to npm or another GH branch or repo.