-
Notifications
You must be signed in to change notification settings - Fork 44
/
gulpfile.mjs
53 lines (46 loc) · 1.07 KB
/
gulpfile.mjs
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
50
51
52
53
import gulp from 'gulp';
import cssimport from 'gulp-cssimport';
import header from 'gulp-header';
import autoPrefixer from 'gulp-autoprefixer';
import del from 'del';
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');
const license = `/* ${pkg.name} ${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n`;
const src = './src';
const dist = './dist/';
let files = [
`${src}/_base.css`,
`${src}/_helpers.css`,
`${src}/_mqs.css`,
`${src}/_print.css`
];
gulp.task('concat', () => {
return gulp.src(`${src}/main.css`)
.pipe(cssimport())
.pipe(header(license))
.pipe(autoPrefixer({
cascade: false
}))
.pipe(gulp.dest(dist));
});
gulp.task('copy', () => {
return gulp.src(files, {})
.pipe(header(license))
.pipe(gulp.dest(dist));
});
gulp.task('clean', (done) => {
del([
dist
]).then(() => {
done();
});
});
gulp.task(
'build',
gulp.series(
'clean',
gulp.parallel('copy', 'concat')
)
);
gulp.task('default', gulp.series('build'));