grunt-bower-require-wrapper
Wraps files with requireJS define() statements for modules definition using bower installed dependencies or user specified ones.
Getting Started
This is a grunt task. Please refer to the Grunt documentation for more information on how to use this task.
To install this particular plugin use:
npm install grunt-bower-require-wrapper --save-dev
Or register it as a dependency on your package.json
and run npm install
Basic dependency requirement header wrapping
The following example read the content of originPath.js
and wraps it in a typical requireJs header specifying each dependency.
grunt; grunt;
The destPath.js
file then contains:
;
Example usage with bower
grunt; grunt;
This example loads all the bower installed dependencies names, then merges it with the modules array to specify the variable name exported for each dependency.
The destPath.js
file content:
/* File generated */;