Closed imathis closed 9 years ago
I think I have something else for you to consider as well:
If I add the Foundation framework to a site using Bower, I end up with 2 JS files I need to include:
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/foundation/js/foundation.min.js"></script>
The issue is that, in that same directory, there is also the uncompressed JS file as well. Now, I could either
/js
but have to copy again when I update Foundation down the road/js
, which seems like the best current optionI'm fine the symbolically linking the file, but I do think it's worth considering whether or not it'd be worthwhile to simply have to call out the JS files you want to put through the pipeline, in their particular order and including their directory location, like so:
combine_js: true
compress_js: false
order_js:
- bower_components/jquery/dist/jquery.min.js
- bower_components/foundation/js/foundation.min.js
- js/app.js
- js/wufoo.js
- js/sharing.js
I agree with @chauncey-garrett here, although the defaults are probably nice there tends to be some weird loose ends here and there that you might not want to include, I'd love to be able to choose what files are put through the minification process like I'd currently do it with Gulp. Right now I'm not sure if it's totally worth using this compared to Gulp but I'm taking a look :) Thanks for the work @imathis
Thinking about this some more, maybe I drop the compression of the javascripts altogether and just add them to the build as is. This way you could use whatever tool you want to build the javascripts and this would just inject it into the blog and write the <script>
tags for you.
I fixed it! All javascripts are compressed independently (and cached) and order is set as you'd expect.
Looks great!
Currently javascripts are separated into
[name].min.js
and standard javascripts. By default pre-minified javascripts are added to the top of a build, given that they are usually libraries. To avoid double compression issues, they were removed from the regular js builds, and added back after. That negates theorder_js
config set by users.This update should restore the order and Octopress Ink should be updated to handle compressing files independently and caching as necessary.