# empirical-angular-gulp-tasks

> Gulp tasks (and configuration) for Empirical Angular apps"

Latest version **0.6.0** (published 2015-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install empirical-angular-gulp-tasks
pnpm add empirical-angular-gulp-tasks
yarn add empirical-angular-gulp-tasks
bun add empirical-angular-gulp-tasks
```

## 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.6.0 |
| Published | 2015-07-21 |
| First published | 2015-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 44 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Will Laurance |
| Maintainers | wlaurance, kriskelly |

## Links

- npm: https://www.npmjs.com/package/empirical-angular-gulp-tasks
- npm.io page: https://npm.io/package/empirical-angular-gulp-tasks

## Dependencies (44)

- [del](https://npm.io/package/del.md) ^1.1.0
- [chai](https://npm.io/package/chai.md) ^3.0.0
- [karma](https://npm.io/package/karma.md) ^0.12.37
- [mocha](https://npm.io/package/mocha.md) ^2.2.5
- [yargs](https://npm.io/package/yargs.md) ^1.3.3
- [gulp-if](https://npm.io/package/gulp-if.md) ^1.2.5
- [gulp-rev](https://npm.io/package/gulp-rev.md) ^2.0.1
- [watchify](https://npm.io/package/watchify.md) ^2.1.1
- [gulp-csso](https://npm.io/package/gulp-csso.md) ^0.2.9
- [gulp-jade](https://npm.io/package/gulp-jade.md) ^0.10.0
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.1
- [browserify](https://npm.io/package/browserify.md) ^8.0.3
- [gulp-print](https://npm.io/package/gulp-print.md) ^1.1.0
- [gulp-watch](https://npm.io/package/gulp-watch.md) ^3.0.0
- [gulp-concat](https://npm.io/package/gulp-concat.md) ^2.4.3
- [gulp-filter](https://npm.io/package/gulp-filter.md) ^1.0.2
- [gulp-inject](https://npm.io/package/gulp-inject.md) ^1.0.2
- [gulp-jshint](https://npm.io/package/gulp-jshint.md) ^1.9.0
- [gulp-rename](https://npm.io/package/gulp-rename.md) ^1.2.0
- [gulp-rimraf](https://npm.io/package/gulp-rimraf.md) ^0.1.1
- [gulp-uglify](https://npm.io/package/gulp-uglify.md) ^1.0.2
- [karma-mocha](https://npm.io/package/karma-mocha.md) ^0.2.0
- [require-dir](https://npm.io/package/require-dir.md) ^0.1.0
- [browser-sync](https://npm.io/package/browser-sync.md) ^1.7.2
- [gulp-plumber](https://npm.io/package/gulp-plumber.md) ^0.6.6
- [gulp-replace](https://npm.io/package/gulp-replace.md) ^0.5.0
- [run-sequence](https://npm.io/package/run-sequence.md) ^1.0.2
- [vinyl-buffer](https://npm.io/package/vinyl-buffer.md) ^1.0.0
- [gulp-imagemin](https://npm.io/package/gulp-imagemin.md) ^2.0.0
- [pretty-hrtime](https://npm.io/package/pretty-hrtime.md) ^0.2.2
- [gulp-cssimport](https://npm.io/package/gulp-cssimport.md) ^1.3.1
- [gulp-ruby-sass](https://npm.io/package/gulp-ruby-sass.md) ^1.0.0-alpha
- [jshint-stylish](https://npm.io/package/jshint-stylish.md) ^1.0.0
- [browserify-shim](https://npm.io/package/browserify-shim.md) ^3.8.1
- [gulp-sourcemaps](https://npm.io/package/gulp-sourcemaps.md) ^1.2.8
- [gulp-ng-annotate](https://npm.io/package/gulp-ng-annotate.md) ^0.4.0
- [gulp-ng-constant](https://npm.io/package/gulp-ng-constant.md) ^0.2.0
- [main-bower-files](https://npm.io/package/main-bower-files.md) ^2.4.1
- [gulp-autoprefixer](https://npm.io/package/gulp-autoprefixer.md) ^2.3.1
- [karma-chai-plugins](https://npm.io/package/karma-chai-plugins.md) ^0.6.0
- [vinyl-source-stream](https://npm.io/package/vinyl-source-stream.md) ^1.0.0
- [karma-sourcemap-loader](https://npm.io/package/karma-sourcemap-loader.md) ^0.3.5
- [gulp-angular-templatecache](https://npm.io/package/gulp-angular-templatecache.md) ^1.4.2
- [connect-history-api-fallback](https://npm.io/package/connect-history-api-fallback.md) 0.0.5

## Recent versions

- 0.6.0 (latest) — 2015-07-21
- 0.5.2 — 2015-07-20
- 0.5.1 — 2015-07-20
- 0.5.0 — 2015-07-14
- 0.4.0 — 2015-07-10
- 0.3.1 — 2015-07-02
- 0.3.0 — 2015-07-02
- 0.2.0 — 2015-06-30
- 0.1.1 — 2015-03-06
- 0.1.0 — 2015-03-05
- 0.0.2 — 2015-02-06
- 0.0.1 — 2015-02-03

## README

Empirical Angular Gulp Tasks [![Build Status](https://travis-ci.org/empirical-org/empirical-angular-gulp-tasks.svg?branch=master)](https://travis-ci.org/empirical-org/empirical-angular-gulp-tasks)
----------------------------

The purpose of this repository is to have a central
location for all of the gulp tasks and development
dependencies in one place for Empirical Angular Apps.

##Tasks

The different gulp tasks are found in `/tasks`

##Installation Configuration

In your application you will need to add `empirical-angular-gulp-tasks`
and `gulp` as dependencies.

```bash
#Save as a development dependency
npm install empirical-angular-gulp-tasks gulp -D
```

or

```bash
#Save as a production dependency
npm install empirical-angular-gulp-tasks gulp --save
```

Also install `gulp` as a global module.

```bash
npm install gulp -g
```

Once you have the module installed, add or edit a
file named `gulpconfig.js`.

In that file, use the following as a guide:

```js
var utilities = require('empirical-angular-gulp-tasks/utilities');

module.exports = {
  src: './src',
  assets: 'assets',
  assets_images: 'images',
  scripts: 'scripts',
  scripts_app: 'app',
  scripts_app_entry: 'app.module.js',
  scripts_app_vendors: 'vendors.js',
  scripts_config: utilities.config.getFile() || (utilities.env.getEnv() + '.config.json'),
  scripts_index: 'index.jade',
  scripts_app_output: 'app.js',
  scripts_app_output_partial: 'app*',
  scripts_vendors_output: 'vendors.js',
  scripts_vendors_output_partial: 'vendors*',
  styles: 'styles',
  styles_main: 'main.scss',
  styles_output: 'app',
  build: './build',
  dist: './dist',
  tmp: './.tmp',
  tmp_config_module: 'quill-grammar.config',
  tmp_config_output: 'config',
  tmp_templates_module: 'quill-grammar.templates',
  tmp_templates_output: 'templates.js',
};
```

Then add or edit `gulpfile.js`

```js
'use strict';

var config = require('./gulpconfig');
var gulp = require('gulp');

require('empirical-angular-gulp-tasks').defineTasks(gulp, config);
```

##Commands

Setting up these gulp tasks will give you:

* `gulp` or `gulp --env=development` which will run your app on PORT 3000
   and watch for file changes.
* `gulp --env=production` will create a production build with in the `./dist` folder
    by default.


##Environments

Our gulp tasks module provides the idea of building
the application in different environments.

We support two environments fully:

* `development`
* `production`

And `staging` partially

###Environment Specific Variables

We use [gulp-ng-constant](https://www.npmjs.com/package/gulp-ng-constant) to inject
environment specific variables into your application. Because we use [browserify](http://browserify.org/)
you can require the specific path the generated contants module from your application
code.

Here is an example from [Quill Grammar](https://github.com/empirical-org/Quill-Grammar)

In `https://github.com/empirical-org/Quill-Grammar/tree/master/src/scripts/development.config.json`
we define a few variables:
```json
{
  "environment": "development",
  "firebaseUrl": "https://quillgrammarstaging.firebaseio.com/",
  "empiricalBaseURL": "https://staging.quill.org/api/v1/",
  "portholeProxy": "https://staging.quill.org/porthole_proxy"
}
```

Then we require the generated module from our custom gulp process:

In `quill-grammar/src/scrips/app/core/core.module.js`:

```js
angular
  .module('quill-grammar.core', [
    'ui.router',
    'LocalStorageModule',
    'autofocus',
    'duScroll',
    'angulartics',
    'angulartics.mixpanel',
    require('../../../../.tmp/config').name,
    require('../../../../.tmp/templates').name,
    require('../../directives/index.js').name,
  ])
  .config(function ($analyticsProvider) {
    $analyticsProvider.virtualPageviews(false);
  });
```

---
_Source: https://npm.io/package/empirical-angular-gulp-tasks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
