This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
forked from Enclavely/tailor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
72 lines (64 loc) · 1.91 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
'use strict';
const gulp = require('gulp');
const path = require('path');
const rename = require('gulp-rename');
const {modulesDev, modulesProd} = require('@sproutsocial/marketing-build-tools/tasks/modules');
const styles = require('@sproutsocial/marketing-build-tools/tasks/styles');
const STYLES = [
'./assets/scss/admin.scss',
'./assets/scss/canvas.scss',
'./assets/scss/frontend.scss',
'./assets/scss/ie.scss',
'./assets/scss/sidebar.scss',
'./assets/scss/tinymce.scss',
];
gulp.task('styles:dev', () => (
gulp.src(STYLES)
.pipe(
styles(
{
cssnano: false,
autoprefixer: false,
sass: {
outputStyle: 'expanded'
}
}
))
.pipe(gulp.dest('./assets/css'))
));
gulp.task('styles', () => (
gulp.src(STYLES)
.pipe(rename({
suffix: '.min'
}))
.pipe(styles())
.pipe(gulp.dest('./assets/css'))
));
const JS_ENTRY = {
canvas: './assets/js/src/canvas.js',
sidebar: './assets/js/src/sidebar.js',
frontend: './assets/js/src/frontend.js',
admin: './assets/js/src/admin.js',
tinymce: './assets/js/src/tinymce.js',
};
gulp.task('modules:dev', modulesDev({
entry: JS_ENTRY,
output: {
filename: '[name].js',
path: path.resolve('./assets/js/dist')
},
}));
gulp.task('modules', modulesProd({
entry: JS_ENTRY,
output: {
filename: '[name].min.js',
path: path.resolve('./assets/js/dist')
},
}));
gulp.task('watch', () => {
gulp.watch(['./assets/scss/**/*.scss'], gulp.series('styles:dev'));
gulp.watch(['./assets/js/src/**/*.js'], gulp.series('modules:dev'));
});
gulp.task('build', gulp.parallel('styles:dev', 'modules:dev'));
gulp.task('develop', gulp.series('build', 'watch'));
gulp.task('default', gulp.parallel('styles', 'modules'));