Inject your require configuration right into your js files from Grunt.
npm install grunt-require-wiredepgrunt-require-wiredep is a Grunt plug-in, which finds your configuration and injects them directly into the js file you specify.
*If you are new to Grunt, you will find a lot of answers to your questions in their getting started guide.
To install the module:
```
npm install --save-dev grunt-require-wiredep
Include the task in your Gruntfile:
`js`
grunt.loadNpmTasks('grunt-require-wiredep');
Create a config block within your Gruntfile:
`js
requireWiredep: {
target: {
// Point to the files that should be updated when
// you run grunt require-wiredep
src: [
'app/views/*/.js', // .js support...
],
// Optional:
// ---------
options: {
cwd: '',
fileTypes: '',
requireUrl: './UrlToConfig.js',
requireConfig: {
// There can be passed config instead file
}
}
}
}
`
*See require-wiredep readme for more options of customization, such as other file types, regex patterns, exclusions, and more.
Options can be specified on both task and target level. See grunt documentation for more details on how this works.*
To inject configuration, pop this in your js file:
`js`
//require:target
//endrequire
Call the Grunt task:
```
grunt require-wiredep