-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGulpfile.js
58 lines (53 loc) · 1.3 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const gulp = require('gulp');
const config = require('config');
const runner = require('punchcard-runner');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const imagemin = require('gulp-imagemin');
const path = require('path');
const options = runner.config({
application: {
library: {
src: [
'lib',
'config',
'content-types',
'input-plugins',
'workflows',
],
},
},
tasks: {
nodemon: {
extension: 'js html yml',
},
build: {
clean: [
'clean:public',
],
assets: [
'sass',
'imagemin',
'js',
'punchcard:js',
'punchcard:images',
],
},
},
server: {
port: config.env.port,
host: config.env.host,
},
});
runner(gulp, options);
gulp.task('punchcard:js', () => {
return gulp.src('node_modules/punchcard-cms/src/js/**/*.js')
.pipe(concat('punchcard.js'))
.pipe(uglify())
.pipe(gulp.dest(path.join(options.assets._folders.public, options.assets.js.dest)));
});
gulp.task('punchcard:images', () => {
return gulp.src('node_modules/punchcard-cms/src/images/**/*')
.pipe(imagemin(options.tasks.images.build.options))
.pipe(gulp.dest(path.join(options.assets._folders.public, options.assets.images.dest)));
});