middleman-ngmin
middleman-ngmin
is an extension for the Middleman static site generator that adds ngmin processing for your JavaScript files to the asset pipeline. This will automatically insert the AngularJS injector annotations to your declarations so that your code can minify correctly.
The code for the Sprockets processor and for bundling ngmin was taken from the ngmin-rails project - it was copied rather than having middleman-ngmin depend on ngmin-rails in order not to bring along a dependency on Rails. Thanks to Jason Morrison and Brandon Tilley for creating ngmin-rails!
Installation
If you're just getting started, install the middleman
gem and generate a new project:
gem install middleman
middleman init MY_PROJECT
If you already have a Middleman project: Add gem 'middleman-ngmin'
to your Gemfile
and run bundle install
.
Configuration
activate :ngmin
That's it! Your assets will now be processed.
Versioning
Like ngmin-rails, middleman-ngmin's version number mirrors the version number for the version of ngmin that is bundled with it.
Bug Reports
This project simply plugs ngmin into Middleman! For bugs in ngmin itself, please file issues in ngmin's issue tracker.
Github Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems: https://github.com/bhollis/middleman-ngmin/issues
The best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit Pull Requests containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.
How to Run Cucumber Tests
- Checkout Repository:
git clone https://github.com/bhollis/middleman-ngmin.git
- Install Bundler:
gem install bundler
- Run
bundle install
inside the project root to install the gem dependencies. - Run test cases:
bundle exec rake test
Upgrading ngmin
The actual ngmin project is bundled into this gem via Browserify. You can update to the latest version of ngmin via Rake:
rake ngmin:build
License
Copyright (c) 2014 Benjamin Hollis. MIT Licensed, see LICENSE for details.