gulp-pipeline-rails
Remove Sprockets from Rails and use gulp-pipleline. Simpler, faster, and integrates very well with the rest of the assets community.
Installation
Add this line to your application's Gemfile:
gem 'gulp-pipeline-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gulp-pipeline-rails
Usage
Remove sprockets from your
application.rb
and initialize Rails withgulp-pipeline-rails
# require 'rails/all' <== DELETE this line require 'gulp/pipeline/rails/all'
Remove unneeded gems such as:
- rails-jquery
- rails-sass
- uglifier
Remove unneeded
config.assets.*
configurations, simply leaveconfig.assets.debug
per environment.Delete your old
public
andtmp
folders.Setup gulp-pipleline to generate your assets
Startup rails and you should be serving from your new asset pipeline!
Goals
This gem is actually quite simple, and most of these goals are accomplished by the primary project gulp-pipleline. Nonetheless, if you are coming from rails, this is what to expect:
Simple
Ultimately this gem is simply serving static assets, we need nothing more complicated.
Easy
With very few configurations it is easy to understand and hard to go wrong. The defaults should be good for almost everyone. The only common config is config.assets.debug
based on the environment.
Community Friendly
Make it easy to use community assets, namely npm
packages
Engine aware
gulp-pipleline and this gem should support engine configurations (at least yours). Beware, if the engines depend on sprockets, we do not have a goal of supporting them.
Performance
There should be no performance penalty for using gulp-pipleline and this gem, in fact, it should be generally faster for development. Static file serving from external servers should be unaffected.
Remove Sprockets
We don't want to match Sprockets in functionality, but remove it from rails and provide simple static asset serving. We want to remain something simpler, if you want something close to sprockets then I encourage you to engage there and help them make their project better.
TODO
- Tests, primarily the
Gulp::Pipeline::Rails::Assets
class which contains asset resolution/path computation
Contributing
- Fork it ( https://github.com/[my-github-username]/gulp-pipeline-rails/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request