Skip to content

pmcalabrese/gulp-renvy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gulp-renvy

NPM

A configurable gulp plugin very inspired by gulp-replace that replace enviroment placeholders simply by passing a placeholder config object.

Install

Use npm for install the package

npm install gulp-renvy

How it works

In your gulpfile.js import gulp-renvy and call it in a pipe renvy(<placeholder object>,<enviroment:String>). For how to define a placeholder object give a look to the following example.

Example

in the gulpfile.js

var renvy = require('gulp-renvy');

var placeholder = {
    'BASE_HREF': {'production':'/rejseforsikring/',   'stage':'/rejseforsikring/'},
    'RAVEN_DEV': {'production':false,                 'stage':true},
    'API_PATH_P': {'production':'/api',               'stage':'/api-dev'},
};
// production and stage are the enviroments;
// BASE_HREF, RAVEN_DEV and API_PATH_P are the placeholders that you can place in your html code

gulp.task('html', function(){
    return gulp.src(html)
        .pipe(renvy(placeholder, 'stage'))
        .pipe(gulp.dest('.', { cwd: bases.dist }));
});

...

TODO

  • tests

About

gulp plugin for replace enviroments variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published