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