Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Please add an unminified version in /dist #33

Closed
pyronaur opened this issue Aug 26, 2016 · 6 comments
Closed

Please add an unminified version in /dist #33

pyronaur opened this issue Aug 26, 2016 · 6 comments

Comments

@pyronaur
Copy link

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.

@fregante
Copy link
Owner

fregante commented Aug 26, 2016

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)

@pyronaur
Copy link
Author

On several occasions, after running minified code through gulp-uglify the end result is a javascript error that says something like unexpected variable l in .... on line 1. I have no idea why Uglify does this, but so far it has never given me trouble for unminified sources.

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 :)

@fregante
Copy link
Owner

fregante commented Aug 26, 2016

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. :)

@fregante
Copy link
Owner

fregante commented Oct 21, 2016

This was fixed in UglifyJS 2.7.0 a couple months ago, please update it :)

fregante pushed a commit that referenced this issue Jan 7, 2017
@fregante
Copy link
Owner

fregante commented Feb 6, 2017

Also, the unminified version is now in v3 ;)

https://github.com/bfred-it/object-fit-images/blob/master/dist/ofi.js

@pyronaur
Copy link
Author

pyronaur commented Feb 6, 2017

Thanks & Thanks 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants