Gulp plugin to inject environment variables
Inject variables with configurable prefix. Based on gulp-inject-env-variables.
This project uses node and npm.
$ npm install gulp-inject-envs
$ # OR
$ yarn add gulp-inject-envs
const injectEnvs = require('gulp-inject-envs')
const env = { foo: 'bar', ping: 'pong' }
gulp.src('**/*.js')
.pipe(injectEnvs(env)) // set custom prefix with second argument e.g. {prefix: 'CUSTOM___' }
.pipe(gulp.dest('/'))
And in code:
const foo = '<ENV::foo>'
console.log(foo) // bar
- Fork it and create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request
MIT