-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
49 lines (39 loc) · 1.49 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var Elixir = require('laravel-elixir'),
gulp = require("gulp"),
compass = require('gulp-compass'),
_ = require('underscore'),
Task = Elixir.Task,
config = Elixir.config;
Elixir.extend("compass", function(src, output, options) {
var defaultOptions = {
generated_images_path: false,
config_file: false,
javascript: config.js.outputFolder,
sourcemap: false,
http_path: false,
relative: true,
comments: true,
require: false,
style: config.css.sass.pluginOptions.outputStyle,
image: config.publicPath + '/images',
font: config.publicPath + '/fonts',
sass: config.assetsPath + '/' + config.css.sass.folder,
css: output || config.publicPath + '/' + config.css.outputFolder
};
options = _.extend(defaultOptions, options);
new Task('compass', function() {
var paths = prepGulpPaths(src, output);
src = paths.src.path;
return gulp.src(src).pipe(compass(options)).on('error', onError)
})
.watch(options.sass + '/**/*.+(sass|scss)');
var onError = function(e) {
return new Elixir.Notification()
.error(e, 'Compass Compilation Failed!');
};
var prepGulpPaths = function(src, output) {
return new Elixir.GulpPaths()
.src(src, options.sass)
.output(options.css, 'app.css');
};
});