-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
50 lines (48 loc) · 2.13 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
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var del = require('del');
gulp.task('clean', () => del(['dist/*']));
gulp.task('html', () => gulp.src('./src/index.html').pipe(gulp.dest('dist')));
gulp.task('assets', () => gulp.src('./src/assets/**/*').pipe(gulp.dest('dist/assets')));
gulp.task('flatpickr', () => gulp.src('./node_modules/flatpickr/dist/**/*').pipe(gulp.dest('dist/lib/flatpickr')));
gulp.task('formiojs', () => gulp.src('./node_modules/formiojs/dist/**/*').pipe(gulp.dest('dist/lib/formiojs')));
gulp.task('seamless', () => gulp.src('./node_modules/seamless/build/**/*').pipe(gulp.dest('dist/lib/seamless')));
gulp.task('font-awesome', () => gulp.src('./node_modules/font-awesome/css/font-awesome.css').pipe(gulp.dest('dist/lib/fontawesome')));
gulp.task('uswds-styles', () => gulp.src('./node_modules/@uswds/uswds/dist/css/uswds.min.css').pipe(gulp.dest('dist/lib/uswds')));
gulp.task('uswds-img', () => gulp.src('./node_modules/@uswds/uswds/dist/img/**/*').pipe(gulp.dest('dist/lib/img')));
gulp.task('uswds-fonts', () => gulp.src(['./node_modules/@uswds/uswds/dist/fonts/**/*', './node_modules/font-awesome/fonts/*']).pipe(gulp.dest('dist/fonts')));
gulp.task('custom', () => gulp.src('./node_modules/@formio/uswds/lib/css/styles.css').pipe(gulp.dest('dist/lib/uswds')));
gulp.task('build', gulp.series('clean', gulp.parallel(
'html',
'assets',
'flatpickr',
'formiojs',
'seamless',
'custom',
'font-awesome',
'uswds-styles',
'uswds-img',
'uswds-fonts',
)));
gulp.task('inlinesource', function () {
return gulp.src('./dist/*.html')
.pipe(plugins.inlineSource())
.pipe(gulp.dest('./dist'));
});
const s3 = require("gulp-s3");
gulp.task('deploy', function () {
var settings = require('../aws.json');
settings.bucket = 'apps.form.io';
settings.region = 'us-east-1';
return gulp.src('./dist/**/*').pipe(s3(settings, {
uploadPath: '/uswds'
}));
});
gulp.task('dev-deploy', function () {
var settings = require('../aws.json');
settings.bucket = 'apps.form.io';
settings.region = 'us-east-1';
return gulp.src('./dist/**/*').pipe(s3(settings, {
uploadPath: '/uswds-dev'
}));
});