-
Notifications
You must be signed in to change notification settings - Fork 20
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
Concatenation or some other method of importing? #5
Comments
This is a great idea. I think we should stick with just one idea though, and preferably something that would work in either JS or CoffeeScript. We have Liquid at our disposal already so if that can be wrangled to work with this, then 👍 Which method do you think is best? In |
I missed this issue, but the compression sentiment is in the air! Here's my original take: jekyll/jekyll#2770 (comment) Here's the same text produced below (so you don't have to read it elsewhere): There's an existing Jekyll/Liquid idiom that looks like this: create an assets file called application.js, and trick it into thinking it's important by marking with an empty
If you place jquery.min.js, foo.js, and whatever.js into your _includes directory, it'll combine them into one file. This also picks up CoffeeScript, provided it also has the empty Two glaring problems:
I propose making a change to Jekyll to do the following:
I can do the legwork to get a PR going if there's interest. Otherwise, I'll take my ideas elsewhere...and put them in a gem. 😜 My only hesitation with the gem approach is not providing this for GitHub Pages users. But maybe we can whitelist it down the road. shrug I'm 👎 on anything that requires |
Whoa. http://duojs.org |
@rodaine What do you think of jekyll/jekyll#2870? It won't minify, but it'll concat nicely, without weird nesting in |
For dead simple minification, there's https://github.com/gjtorikian/jekyll-jsminify |
Some of this will be satisfied by the Just minification is left, right? Maybe a |
Internally, we are using https://github.com/gjtorikian/jekyll-jsminify. But we couldn't find a secure and safe way of exposing this plugin to everyone, so we had to punt on that for now. |
@gjtorikian are you able to expound on the security concerns? |
Mostly, there's an Uglifier option called As you know, the security team is rather small and super overworked. Even if a hundred people came out and said "the minifier poses no security threat," it still needs to be reviewed. But we all ❤️ the 💩 out of Pages, and are trying to make it friendlier for plugins. Zero guarantees or plans on any timeline whatsoever, though. |
@gjtorikian Totally, totally. I don't mean to put any blame on you guys; y'all have been the most accommodating bunch around, and I have mad 💘 for that. I was just curious about what the problem was to see if I could maybe fix it. Force-overriding the |
This issue has been automatically marked as stale because it has not been commented on for at least The resources of the Jekyll team are limited, and so we are asking for your help. If you can still reproduce this error on the 3.1-stableor masterbranch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced Thank you for all your contributions. |
NOTE that on GitHub pages, we can't run any sort of browserify or node_modules importing, so there's no point in having a package.json. See: jekyll/jekyll-coffeescript#5
While Sass comes with @importing out of the box, JS and CoffeeScript lack that functionality. Currently we have patterns like CommonJS, AMD, and (soon-to-be) ES6 Modules for managing our dependencies with browser-side scripts and compiling them into a single, optimized file for production. However, this necessitates build tools and - at least with Github Pages - requires committing these compiled files. 😱
So, I was thinking of forking this bad boy to potentially add some sort of support for any or all of the patterns I've suggested (Vanilla concatenation, CommonJS, AMD, or ES6 Modules), but wanted some input first on which would be most appropriate. I know there is some limitations with supporting plugins up on Github Pages, so I figured I'd ask.
Thoughts?
The text was updated successfully, but these errors were encountered: