Configuration instructions for the wiredep task of Grunt, gruntwiredep
Automatically inject Bower components into the HTML file Automatically injects the Bower component into the HTML file
If you install the components in the following ways:
bower install jquery --savebower install sea.js --save
After installation, you will see it in the bower. json file.
{ "name": "framework-demo", "private": true, "dependencies": { "jquery": "~2.1.4", "jquery-ui": "~1.11.4", "knockout": "^3.3.0", "seajs": "^3.0.0" }}
Configure wirdep Task in the Gruntfile. js File
wiredep: { app: { src: ['<%= config.app %>/index.html'], ignorePath: /^(\.\.\/)*\.\./ } }
Execute the grunt wiredep command
In the index.html file, the components in the Default dependencies dependency are automatically injected into the following labels.
<!-- bower:js --> <script src="/bower_components/jquery/dist/jquery.js"></script> <script src="/bower_components/jquery-ui/jquery-ui.js"></script> <script src="/bower_components/knockout/dist/knockout.js"></script> <script src="/bower_components/seajs/dist/sea.js"></script> <!-- endbower -->
DevDependencies in option in wiredep: injection of dependency components in development; dependencies: injection of dependency components; directory: 'The directory of your Bower packages. 'Directory for storing the bower package. This directory is '. in the bowerrc file. directory