
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
require-wiredep
Advanced tools
Wire require config to many files
Install the module with npm:
$ npm install --save require-wiredep
var config = {
default: {
"baseUrl": "",
"paths": {
"app": "scripts/app",
"bootstrap": "scripts/bootstrap",
"config": "scripts/config",
"angular": "bower_components/angular/angular",
"angularAMD": "bower_components/angularAMD/angularAMD",
"angular-mocks": "bower_components/angular-mocks/angular-mocks"
},
"packages": [
{
"name": "myWidget",
"location": "bower_components/myWidget/dist/component/src",
"main": "js/component"
},
],
"shim": {
"angularAMD": ["angular"],
"angular-mocks": ["angular"],
"angular-resource": ["angular"]
},
"priority": ["angular", "angularAMD"],
"deps": ["/scripts/bootstrap.js"]
},
extended: {
"baseUrl": "/base/",
"paths": {
"Api": "scripts/services/Api",
"ApiResource": "scripts/services/ApiResource",
"modalView": "views/NextStepWidget/modal.html"
}
},
test: {
"url_prefix": "app/",
"url_postfix": "test",
"url_prefix_exclude": ["bower_components"],
"url_postfix_exclude": ["bower_components"],
"callback": function() {
console.log('do something');
}
}
};
module.exports = config;
Above you can see example config file for require-wiredep. Config can contain many targets with configs. Main and required target is default, by using another targets we have possibility to extend default configuration.
There is two possibilities to inject config to you file:
var config = {
//require:default
//endrequire
}
var config = {
"paths":
//require:default:paths
//endrequire
}
require-wiredep work its magic:$ node
> require('require-wiredep')({ src: 'main.js' });
main.js modified.
Install require-wiredep globally to wire up configs from the terminal.
$ npm install -g require-wiredep
$ require-wiredep
Inject require configs to your source code.
Usage: $ require-wiredep [options]
Options:
-h, --help # Print usage information
-v, --version # Print the version
-b, --requireUrl # Path to `require-config.js`
-s, --src # Path to your source file
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using npm test.
Copyright (c) 2014 Pearson English. Licensed under the MIT license.
FAQs
Inject require configs to your source code.
We found that require-wiredep demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.