Gulp Installation Bootstrap

Source: Internet
Author: User


Start-up service

and talk bootstrap.

Gulp cannot be installed globally

--------------------------------------------------------------------

Gulpfile.js


Service configuration file

--------------------------------------------------------------------

@charset "Utf-8";
@import ". /.. /lib/bootstrap/dist/css/bootstrap.min.css ";
@import ". /.. /font/iconfont.css ";


Load on Demand

CSS can import a file with Scss Main.scss


Introduction Example:

------------------------------------

@charset "Utf-8";
@import ". /.. /lib/bootstrap/dist/css/bootstrap.min.css ";
@import ". /.. /font/iconfont.css ";

The imports are generally public.


What to import with what


------------------------------------

JS with the Requier.js (plugin)

<script type= "Text/javascript" src= "Lib/requirejs/require.js" data-main= "Js/demo" ></script>

Data-main= "Js/demo"

Equivalent to an entry function with a demo.js like config file (main module)

What's inside?


Require.config ({
Shim: {//configure incompatible modules
' Bootstrap ': {
Deps: [' jquery '],//deps array, indicating the dependency of the module
Exports: ' Bootstrap '//variable name for output
}
},
Paths: {//custom path relative to current file
"jquery": ". /lib/jquery/dist/jquery.min ",
"Bootstrap": ". /lib/bootstrap/dist/js/bootstrap.min ",
"Demo1": "Demo1"
}
});
Require ([' jquery ', ' Bootstrap ', ' demo1 '), function ($,BOOTSTRAP,DEMO1) {
Console.log (Demo1.web.add (2));
Console.log (Demo1.add (2,3));
Console.log (Demo1.web.ride (2,3));
});


------------------------------------


AMD Requirejs (Load all dependencies first)

CMD Seajs (deferred loading)


AMD examples
Require ([' jquery ', ' Bootstrap ', ' demo1 '), function ($,BOOTSTRAP,DEMO1) {
Console.log (Demo1.web.add (2));
Console.log (Demo1.add (2,3));
Console.log (Demo1.web.ride (2,3));
});


Cmd

Defind (function () {
var a = require (' a ');
A.info ();
var B = require (' B ');
B.info ();

})

var Demoa = require (' Demoa ');//Load Demoa.js


------------------------------------

The files inside are encapsulated in an interlocking package

Scss

Traversal $a = #fff;


Compiling SCSS


------------------------------------

Gulp Installation Bootstrap

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.