Answer the question
In order to leave comments, you need to log in
How to use Gulp with Laravel?
My task for compiling Blade templates from Jade:
gulp.task('views', function () {
var jsFilter = filter('**/*.js', { restore: true });
var cssFilter = filter('**/*.css', { restore: true });
var htmlFilter = filter('**/*.html', { restore: true });
return gulp.src('resources/jade/**/*.jade')
.pipe(jade(config.jade))
.pipe(useref(config.useref))
.pipe(cssFilter)
.pipe(minifyCss())
.pipe(gulp.dest('public/assets/css'))
.pipe(cssFilter.restore)
.pipe(jsFilter)
.pipe(uglify())
.pipe(gulp.dest('public/assets/js'))
.pipe(jsFilter.restore)
.pipe(htmlFilter)
.pipe(rename({extname: ".blade.php"}))
.pipe(gulp.dest('resources/views'));
});
link(rel='stylesheet', href!='assets/css/vendor.css')
// build:css assets/css/app.css
link(rel='stylesheet', href!='assets/css/main.css')
// endbuild
...
script(src!='assets/js/vendor.js')
// build:js assets/js/app.js
script(src!='assets/js/main.js')
// endbuild
// build:css assets/css/app.css
link(rel='stylesheet', href!='url("assets/css/main.css")')
// endbuild
Answer the question
In order to leave comments, you need to log in
Elixir
package.json
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^3.0.0",
"bootstrap-sass": "^3.0.0"
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question