-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minified versions #33
Comments
I am not convinced this is a task for BowerStatic. This also ties into bundling. What I'd want to look into first is what bower tooling (command-line) exists that can help do stuff like this -- perhaps a bundling tool that can take all bower dependencies, wrap them up into a large .js and then minified it. Is the idea to use Bower during development and then create a production bower package when you're ready? I'm not sure I'm really happy with that workflow either... Once we have a better idea of what tooling exists and what workflows people recommend we could consider the possibility to integrate this into BowerStatic. So let's do the research first. |
I know grunt plugins exist that can help the JavaScript developer minify and bundle automatically. You could then ship such a thing as part of a Bower package. The Bower metadata does, to my knowledge, not have information about "here's a minified version!". That sucks, as we'd need such metadata to do anything consistently. We're almost forced to rely on people just knowing that minified versions exist, and including them explicitly, which defeats a large part of dependency management. But that's the state of JS packaging for you... |
When installing javascript packages via bower, you get a directory with a bower.json, That bower.json defines in 'main' the files which are needed to use the package. The files mentioned in 'main' are always the original .js files. However, a lot of maintainers of bower packages, will also distribute the minified versions. When a minified version is present, we can use that version. When a minifed version is not present, the bowerstatic user can (has to?) minify the packages by himself (with or without grunt or similar tools) and place it next to the orginal file, so bowerstatic can use it if the bowerstatic user defines so (use_minified=True). In my believing, we never have to minify the files in bowerstatic; the minifying is done by the maintainer of the javascript package or the bowerstatic user (web app developer). For bundling, we can use two approaches:
ad 1) ad 2) |
Minified versions of files are not included in bower.json. Generating minified versions is left to the publisher (ie bowerstatic), if I understand it right. Do we want a feature (https://github.com/bower/bower/search?p=1&q=minified&type=Issues) for serving minified versions?
The text was updated successfully, but these errors were encountered: