-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·224 lines (206 loc) · 8.22 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
var gulp = require('gulp');
var less = require('gulp-less');
var browserSync = require('browser-sync').create();
var cleanCSS = require('gulp-clean-css');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var ga = require('gulp-ga');
var pug = require('gulp-pug');
var ghPages = require('gulp-gh-pages-will');
var imagemin = require('gulp-imagemin');
var inlinesource = require('gulp-inline-source');
var pkg = require('./package.json');
var cachebust = require('./scripts/gulp-cache-bust');
var pastProjectsEntries = [
{
id: 'rdc',
title: 'Realtor.com',
subtitle: 'Home search and real estate lead generation',
description: 'EngineerApart is helping lead realtor.com (Move Inc.)\'s effort to modernize their tech stack and improve the performance of their web offering. The new Realtor.com features a PWA and high performance React.',
preview_url: 'img/projects/rdc.jpg',
link: 'https://www.realtor.com',
install_ios: '',
install_android: '',
technologies: ['Progressive Web App', 'Next.js', 'React', 'Redux', 'Express', 'GraphQL', 'AWS EC2', 'Cloudfront', 'NewRelic', 'Optimizely', 'Docker', 'Jenkins'],
},
{
id: 'catech',
title: 'CA Technologies',
subtitle: 'B2B Registration Platform',
description: 'Migration of CA Technologies\'s Java-backed Backbone web app to modern tech stack built on top of React and Node.JS.',
preview_url: 'img/projects/catech.jpg',
link: 'https://www.broadcom.com/solutions/ca-technologies-infrastructure-software-solutions',
install_ios: '',
install_android: '',
technologies: ['Node', 'React', 'Redux', 'Express', 'Java', 'Docker'],
},
{
id: 'branchio',
title: 'Branch.io',
subtitle: 'Mobile Measurement and Deep Linking Platform',
description: 'Branch.io, one of the world\'s most well-known deep-linking and link attribution platforms, maintains a plethora of open source SDKs to make their products easy to use regardless of platform. EngineerApart was contracted by Branch to help maintain several of these SDKs and continue to develop them.',
preview_url: 'img/projects/branchio.jpg',
link: 'https://branch.io',
install_ios: '',
install_android: '',
technologies: ['React Native, Javascript, Cordova, Ionic, Phonegap, Node.js'],
},
{
id: 'rehab-guru',
title: 'Rehab Guru',
subtitle: '<i>Redefining exerise prescription</i>',
description: 'Rehab Guru is dedicated to making exercise prescription painless for individuals, therapists and enterprises. RehabGuru required a complete rewrite of their legacy AngularJS website and contracted EngineerApart to rewrite their site in Angular 4 on a modern stack.',
preview_url: 'img/projects/project-rg.jpg',
link: 'https://rehabguru.com',
install_ios: '',
install_android: '',
technologies: ['Angular 4', 'MongoDB', 'AWS ElasticBeanstalk', 'AWS S3',
'CloudFront', 'Parse Server', 'Express'
],
},
{
id: 'la-favorita',
title: 'La Favorita Radio',
subtitle: '<i>Northern California\'s favorite radio station</i>',
description: 'La Favorita Radio is one of Northern California\'s most popular Mexican radio stations. Currently engaged in social network campaigns to grow their listener base, a key component of this campaign was a new mobile application for iOS and Android to extend their reach.',
preview_url: 'img/projects/project-lfr.jpg',
link: 'https://lafavorita.net',
install_ios: 'https://itunes.apple.com/mx/app/la-favorita-radio/id1225009848',
install_android: 'https://play.google.com/store/apps/details?id=com.uncommonconcept.lafavoritaradio&hl=en',
technologies: ['Angular 4', 'Ionic', 'Firebase', 'AWS EC2', 'AWS S3', 'CloudFront', 'Google & Facebook Social Login'],
},
{
id: 'kwik',
title: 'Kwik Industries',
subtitle: 'Easy online purchasing for customers and franchisees',
description: 'With over 1000 stores in 8 states, Kwik Auto Parts needed a platform to manage customer and franchisee orders. We were contracted to offer React consulting and expertise to help complete the project, rebuilding the site in React from a legacy PHP/Wordpress stack.',
preview_url: 'img/projects/project-kwik.jpg',
link: 'https://gokwikparts.com',
install_ios: '',
install_android: '',
technologies: ['React', 'Wordpress', 'MySQL', 'AWS EC2', 'AWS S3', 'CloudFront'],
},
{
id: 'twimby',
title: 'Twimby',
subtitle: 'The world in my backyard',
description: 'Twimby aspires to be your convenience store in the cloud. We built the mobile-friendly Twimby website focusing on great user experience and simplified the ordering process. Twimby exemplifies the modern web technologies from top to bottom.',
preview_url: 'img/projects/twimby.jpg',
link: '',
install_ios: '',
install_android: '',
technologies: ['React', 'Koa', 'PostgreSQL', 'Google Cloud Engine', 'Docker', 'Kubernetes', 'Stripe integration'],
},
];
// Compile LESS files from /less into /css
gulp.task('less', function () {
return gulp.src('less/engineer-apart.less')
.pipe(less())
.pipe(gulp.dest('css'))
.pipe(browserSync.reload({
stream: true
}));
});
// Copy css that does not need processing
gulp.task('copy-minified-css', function () {
return gulp.src([
'./css/bootstrap.min.css'
])
.pipe(gulp.dest('./static/css'));
});
// Minify compiled CSS
gulp.task('minify-css', gulp.series('less', 'copy-minified-css', function () {
return gulp.src('css/engineer-apart.css')
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(postcss([autoprefixer()]))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('./static/css'))
.pipe(browserSync.reload({
stream: true
}));
}));
// Minify JS
gulp.task('minify-js', function () {
var gulpSrc = gulp.src(['js/engineer-apart.js', 'js/location-map.js']);
if (process.env.NODE_ENV === 'production') gulpSrc = gulpSrc.pipe(uglify());
return gulpSrc
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('./static/js'))
.pipe(browserSync.reload({
stream: true
}));
});
// Copy root assets
gulp.task('copy-root', function () {
return gulp.src([
'./CNAME',
'./favicons/**'
])
.pipe(gulp.dest('./static'));
});
// Copy img assets
gulp.task('copy-img', function () {
return gulp.src(['img/**', 'img/projects/**'])
.pipe(imagemin())
.pipe(gulp.dest('./static/img'));
});
// Convert Pug template to html
gulp.task('pug', function buildHTML() {
var gulpSrc = gulp.src('./html/index.pug')
.pipe(pug({
pretty: process.env.NODE_ENV === 'development',
locals: {
carouselEntries: pastProjectsEntries,
}
}));
if (process.env.NODE_ENV === 'production') {
gulpSrc = gulpSrc.pipe(cachebust({ type: 'timestamp' }));
}
return gulpSrc.pipe(gulp.dest('./static/'));
});
gulp.task('inlinesource', gulp.series('pug', 'minify-css', function () {
return gulp.src('./static/*.html')
.pipe(inlinesource())
.pipe(gulp.dest('./static'));
}));
// Build
gulp.task('build', gulp.series('minify-css', 'minify-js', 'copy-root', 'copy-img', 'inlinesource', 'pug'));
// Google Analytics
gulp.task('ga', gulp.series('build', function () {
return gulp.src('./static/index.html')
.pipe(ga({
url: 'engineerapart.com',
uid: 'UA-104209956-1',
anonymizeIp: false,
sendPageView: true,
}))
.pipe(gulp.dest('./static/'));
}));
// Default (Run everything)
gulp.task('default', gulp.series('build', 'ga'));
// Configure the browserSync task
gulp.task('browserSync', function () {
browserSync.init({
server: {
baseDir: './static/'
},
})
})
// Dev task with browserSync
gulp.task('dev', gulp.parallel('build', 'browserSync', function () {
gulp.watch('less/*.less', gulp.parallel('less'));
//gulp.watch(['css/*.css', '!css/*.min.css'], gulp.parallel('minify-css'));
gulp.watch('js/*.js', gulp.parallel('minify-js'));
// Reloads the browser whenever HTML or JS files change
gulp.watch('./html/*.pug', gulp.series('pug', browserSync.reload));
gulp.watch('js/**/*.js', browserSync.reload);
}));
// Deploy
gulp.task('deploy', gulp.series('default', function () {
return gulp.src('./static/**/*')
.pipe(ghPages({
branch: 'master'
}));
}));