-
-
Notifications
You must be signed in to change notification settings - Fork 271
Please add an unminified version in /dist #33
Comments
You can minify it twice, it doesn't affect the final build. I'd wary of your workflow: if a developer changes the position of a file, your URL will be a 404 and the build will fail. I suggest using npm as you can rely on a semantic versioning (plus it includes the unminified library) |
On several occasions, after running minified code through gulp-uglify the end result is a javascript error that says something like As for my workflow - not everything is on NPM, not everything is on bower, I can't control filenames or the order, and I just feel blind when pulling in things that way. Developers have different ideas what a "distribution" version is, some include minified versions, some unminified versions, and some split the "distribution version" into 3 separate files that you have to include in a particular order. I have a YAML file with a list of library names and URLs. When I build libs.js - it pulls fresh libraries, immediately notifying me if the destination file isn't found. I use git for version management, and because I'm always pulling unminified sources, I can see line-by-line diff, not just a changelog. On top of that - all my dev builds are unminified, and when I build for release, everything is beautifully uglified. In 2 years, I've encountered a problem where the destination changed only 1 time. I fixed that in 25 seconds. When I was using a "package manager" like bower - I had to tinker almost with each library to pull it in properly. It's probably not a big deal for you to add an unminified version in your /dist folder, since you're using something to compile from ES2015 already. p.s. The Polyfill source is ES2015 ? A little ironic :) |
Sorry to be such a party pooper, but if uglify gives you an error I would suggest opening an issue on their repo and it will help everybody every time. If currently there are no issues with IIV you can already use its minified version. As you said developers have different ideas on what a distribution version is and currently I prefer not posting anything but the minified browser build to GitHub. PS: No irony, ES2015 just simplifies development and with bublé the output is still neat. :) |
This was fixed in UglifyJS 2.7.0 a couple months ago, please update it :) |
Also, the unminified version is now in v3 ;) https://github.com/bfred-it/object-fit-images/blob/master/dist/ofi.js |
Thanks & Thanks 👍 |
I know that there is a raw version at index.js - but it's unwrapped.
I have a workflow that pulls down all libs with raw github URLs, then bundle all libs together in one single libs.js, and then minify that libs.js myself.
The text was updated successfully, but these errors were encountered: