ngExports
Generates nodified-AngularJS files for your browserified-ready application
Getting Started
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-ngexports --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
Overview
A Grunt plugin I wrote so that I could learn some Grunt. Save some key strokes. Add a bit of opinionation on folder structure. Use this in conjunction with browserify and go from this:
angular; angular; angular;
to this!
// main.jsvar ngExports = ; // /controllers/index.jsexports { $scopename = gabename;}; // /services/gabe.jsexports { thisname = 'Gabe!';};
Module declaration be gone! The module names for each component are the relative file names.
For example, the module for IndexCtrl
is then controllers/index.js
. This makes isolated unit testing easy to setup
(though the module names now become coupled to their folder location).
Config-ish
grunt
License
Copyright (c) 2014 Gabe Scholz. Licensed under the MIT license.