JSPreprocessor
Like Browserify but the C way. Include JavaScript files directly into your source code using #include 'somefile' Use #define FOO bar to replace every instance of FOO with bar.
Installation
Add this line to your application's Gemfile:
gem 'jspreprocessor'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jspreprocessor
Gem Usage
@pre = JSPreprocessor.new
processed_file = @pre.process './folder_with_all_your_javascript/', 'entry_point.js'
File.open 'processed.js', 'w' do |file|
file.write processed_file
end
JavaScript Usage
#include 'lib/stuff'
#define FOO bar
var s = new Stuff();
s.doStuff();
Contributing
- Fork it ( https://github.com/C0deMaver1ck/JSPreprocessor/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