Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

simplyhealth/gulp-ng-config-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gulp Angular Config Provider

Generates and adds a new ngConfig module with a ConfigProvider service to your AngularJS 1 Gulp build.

The plugin takes an array of configuration parameters to extract from an .env file (or process.env) and generates a new module with those parameters. This lets you have environment specific configuration within an AngularJS 1 application, without having to commit in your sensitive configuration properties.

Usage (Gulp)

var gulp = require('gulp');
var config = require('gulp-ng-config');
var concat = require('gulp-concat');

gulp.task('js', function (cb) {
  return gulp.src(['app/**/*.module.js', 'app/**/*.js'])
    .pipe(config(['MyVar', 'MyProp']))
    .pipe('app.js');
});

Usage (AngularJS)

var app = angular.module('app', ['ngConfig']);

app.config(['configProvider', function(configProvider) {
  console.log(configProvider.getConfig); // Outputs configuration object
}]);

About

Gulp plugin that generates a ngConfig module with ConfigProvider

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published