Grunt plugin for envify without browserify.
npm install grunt-envify> Grunt plugin for envify without browserify.
This might not be what you're looking for. If you want to set the
variables in process.env, you're looking for [grunt-env][0]. If you
want to use envify as part of browserify, you want [grunt-browserify][1].
This module is only useful if you'd like [envify][2] but without the
browserify.
[0]: https://github.com/jsoverson/grunt-env
[1]: https://github.com/jmreidy/grunt-browserify
[2]: https://github.com/hughsk/envify
>=0.4.5If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
``shell`
npm install grunt-envify --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js`
grunt.loadNpmTasks('grunt-envify');
to the data object passed into grunt.initConfig().`js
grunt.initConfig({
envify: {
options: {
env: {
// Pass custom env to use instead of process.env.
}
},
your_target: {
// Target-specific file lists and/or env sandbox go here.
}
}
});
`$3
#### options.env
Type:
Object
Default value: process.envAn object of env variables to use instead of process.env.
$3
#### Default
In this example, process.env is used.
`js
grunt.initConfig({
envify: {
your_target: {
files: {
'dest/index.js': ['src/index.js']
}
}
}
});
`#### Custom Env
Override process.env with custom variables.
`js
grunt.initConfig({
envify: {
your_target: {
options: {
env: {
NODE_ENV: 'production'
}
},
files: {
'dest/index.js': ['src/index.js']
}
}
}
});
``Thanks to the following contributors:
* @CarlRosell
* @stefanodacchille
* v0.0.3 - 14 January 2016
* v0.0.2 - 18 July 2014