RequirejsIntegrator
Assumptions
- joins the r.js and its components into project dependencies
- provides the tasks for the assets management
- provides the default r.js config
Requirements
- node.js installed in the system (
node
in the$PATH
)
Installation
Add this line to your application's Gemfile:
gem 'requirejs_integrator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install requirejs_integrator
Configuration
Through RequirejsIntegrator::Config
class:
config = RequirejsIntegrator::Config.new(
"project_javascripts_dir" => "js_dir" # default: "javascripts"
"project_js_compressed_dir" => "jsc_dir" # default: "js"
"project_ui_dir" => "ui_dir" # default: "."
"project_public_dir" => "pub_dir" # default: "public"
"project_config_dir" => "conf" # default: "config"
"project_requirejs_config_file" => "b.js" # default: "build.js"
)
Usage
Add to project's Rakefile:
require 'requirejs_integrator'
RequirejsIntegrator::Tasks.load(RequirejsIntegrator::Config.new)
and list available tasks:
bundle exec rake -T
# rake ri:compile # Compile js
# rake ri:config # Install default r.js config
Versioning
See semver.org
Contributing
- Fork it
- 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 new Pull Request