gulp-dotenv-js
v1.0.0
Published
Plugin for Gulp. Convert .env file in js
Downloads
37
Readme
Gulp dotenv js
A .env file plugin for gulp: compiling .env to js
Install
Gulp-dotend-js require gulp-rename for change name
$ npm install gulp-rename --save
next you install gulp-dotenv-js
$ npm install gulp-dotenv-js --save
Use
Include gulp-dotenv-js and gulp-rename
var dotenv = require('gulp-dotenv-js');
var rename = require('gulp-rename');
gulp.task('dotenv', function () {
return gulp.src('.env')
.pipe(dotenvjs())
.pipe(rename('env.js'))
.pipe(gulp.dest('dist'));
});
Include
Include env.js
file
<script src="assets/dist/js/env.js"></script>
end you can use window.ENV
with your options
License
MIT License