-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (32 loc) · 894 Bytes
/
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
var gulp = require('gulp'),
stylus = require('gulp-stylus');
// public/packages配下に展開したいnpmのパッケージ名
var modules = [
'bootstrap-switch',
'pnotify',
'zeroclipboard',
'bootstrap'
];
// modulesで指定されたnpmライブラリをpublic/packages配下に展開する
gulp.task('export', function() {
modules.map(function(name, index) {
gulp.src('node_modules/' + name + '/**/*')
.pipe(gulp.dest('public/packages/' + name));
});
});
// stylus task
gulp.task('stylus', function () {
var stylusPath = {
'src': 'resources/assets/stylus/**/!(_)*.styl',
'dest': 'public/css'
}
return gulp.src(stylusPath.src)
.pipe(stylus({
compress: true
}))
.on('error', function (err) {
console.error('Error', err.message);
})
.pipe(gulp.dest(stylusPath.dest));
});
gulp.task('default', ['stylus', 'export']);