Last active
September 24, 2016 23:13
-
-
Save LoveAndHappiness/cd530c5e57a95b80e330 to your computer and use it in GitHub Desktop.
Laravel+Polymer Gulpfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var elixir = require('laravel-elixir'); | |
var gulp = require('gulp'); | |
var vulcanize = require('gulp-vulcanize'); | |
// npm install --save-dev browser-sync gulp-vulcanize vulcanize | |
/* | |
|-------------------------------------------------------------------------- | |
| 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 Sass | |
| file for our application, as well as publishing vendor resources. | |
| | |
*/ | |
elixir(function(mix) { | |
mix.sass('app.scss') | |
// .copy('bower_components/**/*', 'public/bower_components') | |
// vulcanize the elements.html in public | |
// .task('vulcanize', 'resources/**/*') | |
.task('copy-elements', 'resources/**/*') | |
.task('copy-bower') | |
.scripts([ | |
'resources/assets/js/app.js' | |
], 'public/js/app.js') | |
.browserSync({ proxy: 'laravel.dev', open: false }); | |
}); | |
gulp.task('vulcanize', function () { | |
return gulp.src('public/elements/elements.vulcanized.html') | |
.pipe(vulcanize({ | |
stripComments: true, | |
inlineCss: true, | |
inlineScripts: true | |
})) | |
.pipe(gulp.dest('public/elements')); | |
}); | |
gulp.task('copy-elements', function () { | |
return gulp.src([ | |
'resources/assets/elements/**/*.html', | |
'resources/assets/elements/*.html', | |
'resources/assets/styles/*.html' | |
]) | |
.pipe(gulp.dest('public/elements')); | |
}); | |
gulp.task('copy-bower', function () { | |
return gulp.src([ | |
'bower_components/**/*' | |
]) | |
.pipe(gulp.dest('public/bower_components')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment