-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulphelper.js
34 lines (28 loc) · 981 Bytes
/
gulphelper.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
const { src, dest } = require('gulp')
const stylus = require('gulp-stylus')
const cache = require('gulp-cached')
const terser = require('gulp-terser')
const cleanCSS = require('gulp-clean-css')
const path = require('path')
function copyPlugin(folder){
const base = path.join('src', folder)
const destDir = path.join('dist', folder)
console.log('Copy Plugin from', base)
src(path.join(base, '*.md'))
.pipe(cache(`plugin-${folder}`))
.pipe(dest(destDir))
src(path.join(base, '*.js'))
.pipe(cache(`plugin-${folder}`))
.pipe(terser())
.pipe(dest(destDir))
src(path.join(base, '*.css'))
.pipe(cache(`plugin-${folder}`))
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(dest(destDir))
src(path.join(base, '*.styl'))
.pipe(cache(`plugin-${folder}`))
.pipe(stylus())
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(dest(destDir))
}
exports.copyPlugin = copyPlugin