-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathgulpfile.js
41 lines (34 loc) · 966 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
40
const gulp = require('gulp');
const posthtml = require('gulp-posthtml');
gulp.task('build-demo', ['posthtml-build-demo', 'copy-css', 'copy-scripts', 'copy-assets']);
gulp.task('posthtml-build-demo', function() {
const plugins = [
require('posthtml-include')({
encoding: 'utf-8',
root: './src/demo/'
})
];
return gulp.src('./src/demo/*.html')
.pipe(posthtml(plugins))
.pipe(gulp.dest('./demo'));
});
gulp.task('copy-css', function() {
return gulp.src([
'./src/demo/styles/*.css',
'./node_modules/dialog-polyfill/dialog-polyfill.css'
])
.pipe(gulp.dest('./demo/styles'));
});
gulp.task('copy-scripts', function() {
return gulp.src([
'./node_modules/eq.js/dist/eq.min.*',
'./node_modules/dialog-polyfill/dialog-polyfill.js'
])
.pipe(gulp.dest('./demo/scripts'));
});
gulp.task('copy-assets', function() {
return gulp.src([
'./src/demo/assets/**/*'
])
.pipe(gulp.dest('./demo/assets'));
});