# @benningfield-group/grunt-build-angularjs

> Grunt task for building AngularJS applications.

Latest version **0.1.2** (published 2018-12-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install @benningfield-group/grunt-build-angularjs
pnpm add @benningfield-group/grunt-build-angularjs
yarn add @benningfield-group/grunt-build-angularjs
bun add @benningfield-group/grunt-build-angularjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-12-18 |
| First published | 2017-08-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 101.1 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| Author | Benningfield Group, Inc. |
| Maintainers | addisonday, alex.jungroth, avejidah, bgi, bobby-benningfield, drew.acheson, joelwat |

## Links

- npm: https://www.npmjs.com/package/@benningfield-group/grunt-build-angularjs
- npm.io page: https://npm.io/package/@benningfield-group/grunt-build-angularjs

## Dependencies (15)

- [glob](https://npm.io/package/glob.md) 7.1.x
- [grunt](https://npm.io/package/grunt.md) 1.0.x
- [@babel/core](https://npm.io/package/@babel/core.md) 7.2.x
- [grunt-babel](https://npm.io/package/grunt-babel.md) 8.0.x
- [grunt-usemin](https://npm.io/package/grunt-usemin.md) 3.1.x
- [grunt-filerev](https://npm.io/package/grunt-filerev.md) 2.3.x
- [jshint-stylish](https://npm.io/package/jshint-stylish.md) 2.2.x
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) 7.2.x
- [grunt-contrib-copy](https://npm.io/package/grunt-contrib-copy.md) 1.0.x
- [grunt-contrib-clean](https://npm.io/package/grunt-contrib-clean.md) 2.0.x
- [grunt-contrib-concat](https://npm.io/package/grunt-contrib-concat.md) 1.0.x
- [grunt-contrib-cssmin](https://npm.io/package/grunt-contrib-cssmin.md) 3.0.x
- [grunt-contrib-jshint](https://npm.io/package/grunt-contrib-jshint.md) 2.0.x
- [grunt-contrib-uglify](https://npm.io/package/grunt-contrib-uglify.md) 4.0.x
- [grunt-angular-templates](https://npm.io/package/grunt-angular-templates.md) 1.1.x

## Recent versions

- 0.1.2 (latest) — 2018-12-18
- 0.1.1 — 2018-12-17
- 0.1.0 — 2018-12-13
- 0.0.8 — 2017-10-18
- 0.0.7 — 2017-10-04
- 0.0.6 — 2017-10-04
- 0.0.5 — 2017-10-04
- 0.0.4 — 2017-10-04
- 0.0.3 — 2017-10-04
- 0.0.2 — 2017-10-03
- 0.0.1 — 2017-08-28

## README

### Install

Install the grunt task.

```
yarn add --dev @benningfield-group/grunt-build-angularjs
```

Install peer dependencies.

```
yarn add --dev grunt-angular-templates@~0.5.7 grunt-babel@^6.0.0 grunt-contrib-clean@~0.6.0 grunt-contrib-concat@~0.5.1 grunt-contrib-copy@~0.8.0 grunt-contrib-cssmin@~0.12.3 grunt-contrib-jshint@~0.11.2 grunt-contrib-uglify@~0.9.2 grunt-filerev@~2.3.1 grunt-usemin@~3.0.0 jshint-stylish@^2.2.1 
```

### Configuration

Create a Gruntfile.js and set up the gruntBuildAngularJS task.  The task takes two options.

1. angularModuleName: A string that is the name of your base AngularJS module.
   Note that there _must_ be a JS file in the root directory matching this name
   (e.g. BGI.GruntBuildAngularJSExample.js in the example below).
2. indexFile: An optional string that specifies the entry point for your
   single-page application.  This option defaults to "index.html."

```javascript
module.exports = function(grunt) {
  'use strict';

  grunt.loadNpmTasks('@benningfield-group/grunt-build-angularjs');

  grunt.initConfig({
    buildAngularJS: {
      prod: {
        options: {
          angularModuleName: 'BGI.GruntBuildAngularJSExample',
          indexFile: 'index.html'
        }
      }
    }
  });

  grunt.registerTask('default', [
    'buildAngularJS'
  ]);
};
```

In your index file, specify build comments.  Note that the final JavaScript
build tag is important.  It must follow the format `\`js/${angularModuleName}.min.js\``
(e.g. `js/BGI.GruntBuildAngularJSExample.min.js` in the example below.

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>grunt-build-angularjs-example</title>

    <!-- build:css css/lib.min.css -->
    <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
    <!-- endbuild -->

    <!-- build:css css/grunt-build-angularjs.min.css -->
    <link rel="stylesheet" href="clock/clock.css">
    <!-- endbuild -->
  </head>

  <body ng-app="BGI.GruntBuildAngularJSExample">
    <div class="container">
      <div class="row">
        <div class="col-xs-12">
          An example of the grunt-build-angularjs Grunt task.
        </div>
      </div>

      <clock></clock>
    </div>

    <!-- build:js js/lib.min.js -->
    <script src="node_modules/angular/angular.min.js"></script>
    <!-- endbuild -->

    <!-- build:js js/BGI.GruntBuildAngularJSExample.min.js -->
    <script src="BGI.GruntBuildAngularJSExample.js"></script>
    <script src="clock/clock.js"></script>
    <!-- endbuild -->
  </body>
</html>
```
### Building

Simply run ```grunt```.  You can get some additional output using the `-v`
(verbose) flag.  The resulting built project will be in a `build` folder.

### Example

See the @benningfield-group/grunt-build-angularjs-example repository:
https://bitbucket.org/benningfieldsuperitteam/grunt-build-angularjs-example

---
_Source: https://npm.io/package/@benningfield-group/grunt-build-angularjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
