-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
49 lines (46 loc) · 1.65 KB
/
gulpfile.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 gulp = require('gulp'),
plumber = require('gulp-plumber'),
gutil = require('gulp-util'),
autoprefixer = require('autoprefixer'),
sourcemaps = require('gulp-sourcemaps'),
postcss = require('gulp-postcss'),
poststylus = require('poststylus'),
stylus = require('gulp-stylus'),
axis = require('axis'),
rupture = require('rupture'),
lost = require('lost'),
browserSync = require('browser-sync'),
reload = browserSync.reload;
gulp.task('browser-sync', function() {
browserSync({
files: [ // Directories of your OctoberCMS files, HTML/TXT/JS... etc
'content/*.htm',
'content/static-pages/*.htm',
'content/placeholder/*.txt',
'layouts/*.htm',
'pages/*.htm',
'partials/*.htm',
'assets/javascript/*.js'
],
proxy: {
target: "localhost:8888/yourthemehere" // Enter your dev environment proxy
}
});
gulp.watch('assets/css/stylus/*.styl', ['stylus']).on('change', reload); // Watches all Stylus files for changes
});
gulp.task('stylus', function() {
gulp.src('assets/css/stylus/main.styl') // Compiles main.styl ... intended for a manifest file ie: http://sassdirector.com/examples/index.html (using Sass examples)
.pipe(plumber({errorHandler: function (err) { gutil.beep(); console.log(err);}}))
.pipe(stylus({
use: [
poststylus([
'autoprefixer',
'lost'
]),
axis(),
rupture()
]
}))
.pipe(gulp.dest('assets/css/')) // Compile everything into one file, main.css
});
gulp.task('default', ['browser-sync']);