forked from JeffreyWay/laravel-elixir-stylus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
42 lines (36 loc) · 1.11 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
var CssTask = require('laravel-elixir/dist/tasks/CssTask').default;
/*
|----------------------------------------------------------------
| Stylus Compilation Task
|----------------------------------------------------------------
|
| This task will compile your Stylus, including minification and
| and auto-prefixing. Additionally it supports any postStylus
| plugins that you want to include with your compilation.
|
*/
Elixir.config.css.stylus = {
folder: 'stylus',
search: '/**/*.styl',
plugin: require('gulp-stylus'),
pluginOptions: {
use: [
require('poststylus')(['lost'])
]
}
};
Elixir.extend('stylus', function(src, output, options) {
new CssTask('stylus', getPaths(src, output), options || {});
});
/**
* Prep the Gulp src and output paths.
*
* @param {string|array} src
* @param {string|null} output
* @return {object}
*/
var getPaths = function(src, output) {
return new Elixir.GulpPaths()
.src(src, Elixir.config.get('assets.css.stylus.folder'))
.output(output || Elixir.config.get('public.css.outputFolder'), 'app.css');
};