标签:node min 不用 css set mil fluent defining weight
上篇文章写了Gulp编译前端文件,这篇记录下在搭建博客中使用Gulp
sudo npm install bower
{ "name": "blog", "description": "My Blog", "ignore": [ "**/.*", "node_modules", "vendor/bower_dl", "test", "tests" ] }
bower install jquery bootstrap --save
var gulp = require(‘gulp‘); var elixir = require(‘laravel-elixir‘); /* |-------------------------------------------------------------------------- | Elixir Asset Management |-------------------------------------------------------------------------- | | Elixir provides a clean, fluent API for defining some basic Gulp tasks | for your Laravel application. By default, we are compiling the Less | file for our application, as well as publishing vendor resources. | */ /** * 拷贝操作 */ gulp.task("copyfiles", function(){ // js gulp.src("vendor/bower_dl/jquery/dist/jquery.js") .pipe(gulp.dest("resources/assets/js/")); // bootstrap gulp.src("vendor/bower_dl/bootstrap/less/**") .pipe(gulp.dest("resources/assets/less/bootstrap")); gulp.src("vendor/bower_dl/bootstrap/dist/js/bootstrap.js") .pipe(gulp.dest("resources/assets/js/")); // font 不用编译和合并 直接复制到public就可以 gulp.src("vendor/bower_dl/bootstrap/fonts/**") .pipe(gulp.dest("public/assets/fonts")); }); elixir(function(mix) { // 合并两个js文件 mix.scripts([‘js/jquery.js‘, ‘js/bootstrap.js‘], ‘public/assets/js/admin.js‘, ‘resources/assets‘ ); // 编译admin.less到public目录下 mix.less(‘admin.less‘, ‘public/assets/css/admin.css‘); });
@import "bootstrap/bootstrap"; @import "//fonts.googleapis.com/css?family=Roboto:400,300"; @btn-font-weight: 300; @font-family-sans-serif: "Roboto", Helvetica, Arial, sans-serif; body, label, .checkbox label { font-weight: 300; }
gulp copyfiles
gulp
{{--CSS--}} <link rel="stylesheet" href="/assets/css/admin.css">
{{--JS--}} <script src="/assets/js/admin.js"></script>
标签:node min 不用 css set mil fluent defining weight
原文地址:http://www.cnblogs.com/sun-kang/p/7624749.html