Configuration instructions for the wiredep task of Grunt, gruntwiredep

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.