Gem to replace the Rails asset pipeline with a Grunt.js-based workflow, providing dependencies via Bower.
Half Pipe is a generator to get you up and running quickly with a Grunt setup for building client-side code in Rails apps. We believe that your asset workflow is yours and you should be able to configure it however you need to.
Who is this For?
Looking for Contributors
If you take a look at our issue board on waffle.io you'll see that we have some big plans for future releases of Half Pipe. If you are interested in working on a feature or fixing a bug, please feel free to move the issue to "In Progress" and send a PR when you're ready. If you have ideas or questions, please feel free to open an issue.
We believe that the directory structured imposed by the Rails asset pipeline was a step in the right direction, but did not go far enough in making client code a first-class part of your application. Given that, we have put assets at the same level as the rest of your Ruby code:
app/styles- Sass templates
In a Rails app, use
rails g half_pipe:install to get started. This will generate the directory structure and any files necessary for your Grunt workflow.
|Gruntfile.js||Main configuration for your Grunt tasks|
|bower.json||3rd-party asset dependencies (includes normalize-css, requirejs, and html5shiv by default)|
|package.json||NPM dependencies (ie. Bower, Grunt, any Grunt tasks)|
|app/scripts/application.js||Entry point for requirejs; includes requirejs configuration, main module require and bootstraps page|
|app/scripts/main.js||Main module for your app; includes page initialization and requires any modules necessary for initialization|
|config/initializers/sass.rb||Bootstraps Sass with bower importer|
Beyond these files, the generator also removes sprockets from
config/application.rb and replaces
Build assets by running
public/scripts and stylesheets to
In this early release if you want to configure anything, you'll have to manually change
Gruntfile.js. We'd like to make this more invisible in the future; please post any use cases for configuration as Github issues.
- Removes dependency on rack-asset-compiler and embeds the code in this gem
- Override Rails'
rake assets:precompileto run
grunt buildfor easier deployments
- Allow for configuring asset server with
config.half_pipe.serve_assets = true|false
- Use Almond for requirejs optimization so as not to need requirejs in production
- v0.2 - Asset fingerprinting
- Precompilation of client-side templates
- Configurable asset directories
- Configurable build directories
- Better support for images
- Support for additional module loaders (including ES6 modules)
- Padrino support
- Middleman support
- Support for most popular AltJS languages
- BYO support for less common languages
- Automatic symlinking of CSS files within bower to SCSS partials within
- Read .bowerrc for Bower directory