-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
39 lines (34 loc) · 981 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
37
38
39
const { task, src, dest, series } = require('gulp');
const postcss = require('gulp-postcss');
const rename = require('gulp-rename');
const mocha = require('gulp-mocha');
const del = require('del');
const easysprite = require('./index.js');
task('clean:demo', (done) => {
del(['./test/demo/sprites/**']);
done();
});
task('runDemo', (done) => {
src('./test/fixtures/input.css')
.pipe(
postcss([
easysprite({
imagePath: './test/demo/images',
spritePath: './test/demo/sprites',
// padding: 20,
// outputDimensions: true,
// algorithm: 'binary-tree',
}),
])
)
.pipe(rename('output.css'))
.pipe(dest('./test/demo/'));
done();
});
task('runTest', () => {
return src('test/*.test.js', { read: false }).pipe(mocha());
});
// task('project', series('project:basic'));
task('demo', series('clean:demo', 'runDemo'));
task('test', series('runTest'));
task('default', series('test'));