2015-07-12 15:01:42 -04:00
|
|
|
var elixir = require('laravel-elixir');
|
|
|
|
|
2015-12-16 12:09:44 -05:00
|
|
|
// Custom extensions
|
|
|
|
var gulp = require('gulp');
|
|
|
|
var Task = elixir.Task;
|
|
|
|
var fs = require('fs');
|
|
|
|
|
|
|
|
elixir.extend('queryVersion', function(inputFiles) {
|
|
|
|
new Task('queryVersion', function() {
|
|
|
|
var manifestObject = {};
|
|
|
|
var uidString = Date.now().toString(16).slice(4);
|
|
|
|
for (var i = 0; i < inputFiles.length; i++) {
|
|
|
|
var file = inputFiles[i];
|
|
|
|
manifestObject[file] = file + '?version=' + uidString;
|
|
|
|
}
|
|
|
|
var fileContents = JSON.stringify(manifestObject, null, 1);
|
|
|
|
fs.writeFileSync('public/build/manifest.json', fileContents);
|
|
|
|
}).watch(['./public/css/*.css', './public/js/*.js']);
|
|
|
|
});
|
|
|
|
|
2015-07-12 15:01:42 -04:00
|
|
|
elixir(function(mix) {
|
2015-10-22 14:41:49 -04:00
|
|
|
mix.sass('styles.scss')
|
|
|
|
.sass('print-styles.scss')
|
2016-01-20 17:13:13 -05:00
|
|
|
.sass('export-styles.scss')
|
2015-12-30 13:38:18 -05:00
|
|
|
.browserify('global.js', 'public/js/common.js')
|
2015-12-16 12:09:44 -05:00
|
|
|
.queryVersion(['css/styles.css', 'css/print-styles.css', 'js/common.js']);
|
2015-07-12 15:01:42 -04:00
|
|
|
});
|