-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adding Snockets compilation of js, cs and ts files #375
Conversation
…ested atm though)
The plan right now is to move from asset-rack to grunt for managing front end assets. See #240 for more on this. Feel free to join the #sailsjs IRC channel on freenode if you have any questions. Thanks for your recent contributions! |
Whoops! Didn't see you already mentioned that issue. You wouldn't have to really learn yeoman/grunt for basic usage, out of the box it would support most of what asset-rack supports right now. If you do spend a little time with it, it is super configurable and you wouldn't need to modify asset rack or sails to get things like snockets or stylus because there are grunt tasks for them. |
Thanks! I'll have to look into Yeoman and Grunt a little more. I think it's safe to say I don't have enough experience with either of them at this point. What I'd really like to do though is get Sails working better out of the box. Are these changes ok as an interim solution? |
I'm here in search of a way to minify and concatenate assets in a specific order, but I'm new to Snockets. Is this a solution to that problem? Do you have an example of how this might work? I'm ready to pull this in to my fork even if this doesn't make it into the official repo. I'm kind of desperate for a decent solution. |
@greeze So concatenation works out of the box. Just add I haven't tried minifying Sails assets but the snocket assets should work the same as any other asset once it's concatenated by snockets so I think (and I could be wrong here) that Sails will automatically minify your assets when sails.config.environment is set to production. |
Excellent. I'm going to fool around with this right now. Unfortunately, I don't think Sails automatically minifies assets that are pulled in from views, even in production. I tested by adding a script src to one of my jade templates and pulling in a .js file from the /public directory. Even when I started the server with |
@greeze No problem. Let me know if you figure out how to minify your assets, I'm on course to run into the same problem in about 7 days! |
In other news, Github should add a feature to easily merge pull requests into different forks. Edit: Also, this appears to work flawlessly. Thank you! |
@D1plo1d, can you resubmit your pull requests to the development branch please. |
@dcbartlett Fixed. Sorry about that, I'll update my other pull requests as well. moved to: #384 |
This patch adds snockets support to sails via asset-rack. The major issue this addresses is dependency management in client side code.
From my perspective
#= require "my_dependency"
has always been very readable, predictable and concise.But I wonder if there are different camps on this. What's the consensus?