Grunt configuration documentation for the WIREDEP task

Source: Internet
Author: User

Automatically inject Bower component into the HTML file automatically injects components of Bower into HTML files
If we install the components in the following ways
Bower Install jquery--savebower Install sea.js--save



It will be seen in the Bower.json file after installation
{  "name": "Framework-demo",  "private": True,  "dependencies": {    "jquery": "~2.1.4",    "Jquery-ui" : "~1.11.4",    "Knockout": "^3.3.0",    "Seajs": "^3.0.0"  }}



Configuring WIRDEP Task in the Gruntfile.js file
  WIREDEP: {      app: {        src: [' <%= Config.app%>/index.html '],        ignorepath:/^ (\.\.\/) *\.\./      }    }

Execute Grunt WIREDEP command
In the index.html file, the components in the default dependencies dependency are automatically injected into the following tabs.
<!--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>    

Parameter devdependencies in option in WIREDEP: Inject the dependency component in the development version, dependencies: inject the dependent component; directory: ' The directory of your Bower packages. ' The directory that holds the Bower package, which is a. Directory in the '. BOWERRC ' file.

Configuration documentation for WIREDEP tasks for grunt

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.