mod-build 4.0.102-beta.1 → 4.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/public/resources/scripts/abandonment/abandonment-a4bbb36fbc8ed64042b8.min.js +2 -0
- package/public/resources/scripts/abandonment/abandonment.min.js +2 -0
- package/public/resources/scripts/callrail/callrail-14011d73b50a928de4b4.min.js +2 -0
- package/public/resources/scripts/callrail/callrail.min.js +2 -0
- package/public/resources/scripts/footer/footer-component-46dc0d7ca6af4fc3b76b.min.js +2 -0
- package/public/resources/scripts/footer/footer-component.min.js +2 -0
- package/public/resources/scripts/geolocation/geolocation.min.js +2 -0
- package/public/resources/scripts/helpers/addVWOTestQueryParam.min.js +2 -0
- package/public/resources/scripts/helpers/addVWOTestQueryParam.min.js.map +1 -0
- package/public/resources/scripts/helpers/additionalOpts.min.js +2 -0
- package/public/resources/scripts/helpers/additionalOpts.min.js.map +1 -0
- package/public/resources/scripts/helpers/calls-only.min.js +2 -0
- package/public/resources/scripts/helpers/calls-only.min.js.map +1 -0
- package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js +2 -0
- package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js.map +1 -0
- package/public/resources/scripts/helpers/initNumericOnlyFields.min.js +2 -0
- package/public/resources/scripts/helpers/initNumericOnlyFields.min.js.map +1 -0
- package/public/resources/scripts/helpers/initQSForm.min.js +2 -0
- package/public/resources/scripts/helpers/initQSForm.min.js.map +1 -0
- package/public/resources/scripts/helpers/initQuadTransform.min.js +2 -0
- package/public/resources/scripts/helpers/initQuadTransform.min.js.map +1 -0
- package/public/resources/scripts/helpers/isZipCodeValid.min.js +2 -0
- package/public/resources/scripts/helpers/isZipCodeValid.min.js.map +1 -0
- package/public/resources/scripts/helpers/observeVWOVariation.min.js +2 -0
- package/public/resources/scripts/helpers/observeVWOVariation.min.js.map +1 -0
- package/public/resources/scripts/helpers/opts.min.js +2 -0
- package/public/resources/scripts/helpers/opts.min.js.map +1 -0
- package/public/resources/scripts/jornaya.hbs +35 -0
- package/public/resources/scripts/jornaya.html +35 -0
- package/public/resources/scripts/mod-alytics/modalytics-be44027508c0438f6709.min.js +2 -0
- package/public/resources/scripts/mod-alytics/modalytics.min.js +2 -0
- package/public/resources/scripts/mod-form/form/contractor-0918337caf3dfede1609.min.js +2 -0
- package/public/resources/scripts/mod-form/form/contractor.min.js +2 -0
- package/public/resources/scripts/mod-form/form/homeowner-19a121b0e596042326f4.min.js +2 -0
- package/public/resources/scripts/mod-form/form/homeowner.min.js +2 -0
- package/public/resources/scripts/mod-utils/modutils-bc275eb41af515f626ef.min.js +2 -0
- package/public/resources/scripts/mod-utils/modutils.min.js +2 -0
- package/public/resources/scripts/trusted-form.hbs +38 -0
- package/public/resources/scripts/trusted-form.html +38 -0
- package/public/resources/styles/components/abandonment/abandonment-8a673f060817db6cb7dc.min.css +1 -0
- package/public/resources/styles/components/abandonment/abandonment.min.css +1 -0
- package/public/resources/styles/components/footer/mod-footer-d233fa64b6c8297c70ec.min.css +1 -0
- package/public/resources/styles/components/footer/mod-footer.min.css +1 -0
- package/public/resources/styles/components/footer/qs-footer-926e67c28d10c729db46.min.css +1 -0
- package/public/resources/styles/components/footer/qs-footer.min.css +1 -0
- package/src/resources/templates/modals/privacy/index.hbs +88 -89
- package/src/resources/templates/modals/privacy/index.html +88 -89
- package/src/resources/templates/modals/terms/index.hbs +8 -7
- package/src/resources/templates/modals/terms/index.html +8 -7
- package/src/scripts/globals.js +1 -3
- package/src/scripts/plugins.js +0 -3
- package/tasks/get-default-trade-questions.js +121 -157
- package/tasks/templates.js +2 -4
- package/gulp-tasks/add-path-subdirectories.js +0 -34
- package/gulp-tasks/build-stat.js +0 -9
- package/gulp-tasks/build.js +0 -28
- package/gulp-tasks/cache-bust.js +0 -19
- package/gulp-tasks/check-seasonal-variations.js +0 -21
- package/gulp-tasks/clean.js +0 -10
- package/gulp-tasks/combine-files.js +0 -7
- package/gulp-tasks/compile.js +0 -44
- package/gulp-tasks/copy-files-to-build-path.js +0 -8
- package/gulp-tasks/copy-fonts.js +0 -6
- package/gulp-tasks/copy-json.js +0 -6
- package/gulp-tasks/copy-resources-to-dist.js +0 -6
- package/gulp-tasks/copy-videos.js +0 -6
- package/gulp-tasks/extras.js +0 -22
- package/gulp-tasks/grab-cdn.js +0 -74
- package/gulp-tasks/grab-form-helpers.js +0 -55
- package/gulp-tasks/grab-global-images.js +0 -121
- package/gulp-tasks/grab-images.js +0 -79
- package/gulp-tasks/grab-shared-components.js +0 -46
- package/gulp-tasks/grab-shared-scripts.js +0 -275
- package/gulp-tasks/grab-theme-json.js +0 -24
- package/gulp-tasks/grab-tooltips-json.js +0 -33
- package/gulp-tasks/js-lint-husky.js +0 -35
- package/gulp-tasks/js-lint.js +0 -24
- package/gulp-tasks/minify.js +0 -131
- package/gulp-tasks/sass-lint.js +0 -15
- package/gulp-tasks/serve.js +0 -74
- package/gulp-tasks/settings.js +0 -22
- package/gulp-tasks/styles.js +0 -42
- package/gulp-tasks/tasks.js +0 -475
- package/gulp-tasks/templates.js +0 -288
- package/src/data/footer.js +0 -119
- package/src/scripts/default/additional-assets.js +0 -60
- package/src/scripts/default/rage-clicking.js +0 -54
- package/src/scripts/default/show-utility-providers.js +0 -28
- package/src/scripts/url-cleaner.js +0 -8
- package/src/scripts/vendor/google-tag-manager-head.js +0 -6
- package/src/scripts/vendor/heap-addeventproperties-identify.js +0 -262
- package/src/scripts/vendor/heap-tracking.js +0 -9
- package/src/styles/partials/_contact-us.scss +0 -196
- package/src/styles/partials/_google-address-autocomplete.scss +0 -52
- package/src/styles/partials/_mixins.scss +0 -39
- package/src/styles/partials/_modal-pages.scss +0 -125
- package/src/styles/partials/_modernize-colors.scss +0 -128
- package/src/styles/partials/_qs-footer.scss +0 -68
- package/src/styles/partials/_quote-footer-v1.scss +0 -79
- package/src/styles/partials/_quote-footer-v2.scss +0 -64
- package/src/styles/partials/_quote-footer-v3.scss +0 -65
- package/src/templates/_partials/scripts/deferred-styles.html +0 -16
- package/src/templates/_partials/scripts/heap-bundle.html +0 -5
- package/src/templates/_partials/scripts/heap.html +0 -4
- package/src/templates/_partials/scripts/utm-params.html +0 -9
- package/src/templates/components/qs-footer.html +0 -55
- package/src/templates/components/quote-footer-v1.html +0 -148
- package/src/templates/components/quote-footer-v2.html +0 -169
- /package/tasks/{addSeasonalchanges.js → add-seasonal-changes.js} +0 -0
- /package/tasks/{setupDevOpsTrackingId.js → setup-dev-ops-tracking-id.js} +0 -0
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var fs = require('fs');
|
|
2
|
-
var request = require('request');
|
|
3
|
-
var source = require('vinyl-source-stream');
|
|
4
|
-
|
|
5
|
-
// helper to allow us to define an "end" event to multiple streams
|
|
6
|
-
function streamToDestination(gulp, gulpPlugins, siteSettings) {
|
|
7
|
-
var finalDestination;
|
|
8
|
-
|
|
9
|
-
if (!fs.existsSync(siteSettings.distFolder)) {
|
|
10
|
-
finalDestination = siteSettings.srcFolder;
|
|
11
|
-
} else {
|
|
12
|
-
finalDestination = siteSettings.distFolder;
|
|
13
|
-
}
|
|
14
|
-
return new Promise(resolve => { // eslint-disable-line no-undef
|
|
15
|
-
const cachebuster = Math.round(new Date().getTime() / 1000);
|
|
16
|
-
request(`https://${siteSettings.nodeEnv}/quote/resources/data/tooltips.json?cb=${cachebuster}`)
|
|
17
|
-
.on('response', resp => {
|
|
18
|
-
if (resp.statusCode !== 200) {
|
|
19
|
-
throw new Error(`${resp.statusCode}: Error while fetching tooltips.json`);
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
.pipe(source('tooltips'))
|
|
23
|
-
.pipe(gulpPlugins.rename('tooltips.json'))
|
|
24
|
-
.pipe(gulp.dest(`${finalDestination}/${siteSettings.dataSubfolder}`))
|
|
25
|
-
.on('finish', resolve);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
30
|
-
return function() {
|
|
31
|
-
return streamToDestination(gulp, gulpPlugins, siteSettings);
|
|
32
|
-
};
|
|
33
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/* global process */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Details in SEO-11
|
|
5
|
-
*
|
|
6
|
-
* This is the same as js-lint with the folling modifications:
|
|
7
|
-
* - it does not produce eslint-results.xml file
|
|
8
|
-
* - it fails on any error or warning
|
|
9
|
-
*
|
|
10
|
-
* We only run it from Husky git hook.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
14
|
-
// Default jsLint settings
|
|
15
|
-
if ('undefined' === typeof siteSettings.jsLint) {
|
|
16
|
-
siteSettings.jsLint = {
|
|
17
|
-
configFile: './node_modules/mod-build/.eslintrc.yml'
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return function() {
|
|
22
|
-
return gulp.src([
|
|
23
|
-
siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/**/*.js',
|
|
24
|
-
'gulpfile.babel.js',
|
|
25
|
-
'gulp-tasks/*.js',
|
|
26
|
-
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/vendor/**/*.js' // do not lint 3rd party scripts
|
|
27
|
-
])
|
|
28
|
-
.pipe(gulpPlugins.eslint(siteSettings.jsLint))
|
|
29
|
-
.pipe(gulpPlugins.eslint.format())
|
|
30
|
-
.pipe(gulpPlugins.eslintThreshold.afterWarnings(1, function() {
|
|
31
|
-
return process.exit(2);
|
|
32
|
-
}))
|
|
33
|
-
.pipe(gulpPlugins.eslint.failAfterError());
|
|
34
|
-
};
|
|
35
|
-
};
|
package/gulp-tasks/js-lint.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
2
|
-
var fs = require('fs');
|
|
3
|
-
|
|
4
|
-
// Default jsLint settings
|
|
5
|
-
if ('undefined' === typeof siteSettings.jsLint) {
|
|
6
|
-
siteSettings.jsLint = {
|
|
7
|
-
configFile: './node_modules/mod-build/.eslintrc.yml'
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return function() {
|
|
12
|
-
return gulp.src([
|
|
13
|
-
siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/**/*.js',
|
|
14
|
-
'gulpfile.babel.js',
|
|
15
|
-
'gulp-tasks/*.js',
|
|
16
|
-
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/vendor/**/*.js', // do not lint 3rd party scripts,
|
|
17
|
-
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/resources/**/*.js', // do not lint copied shared resource scripts,
|
|
18
|
-
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsCompiledFolder + '**/*.js' // do not lint compiled scripts
|
|
19
|
-
])
|
|
20
|
-
.pipe(gulpPlugins.eslint(siteSettings.jsLint))
|
|
21
|
-
.pipe(gulpPlugins.eslint.format())
|
|
22
|
-
.pipe(gulpPlugins.eslint.format('junit', fs.createWriteStream('eslint-results.xml')));
|
|
23
|
-
};
|
|
24
|
-
};
|
package/gulp-tasks/minify.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
const babelOpts = {
|
|
2
|
-
presets: ['@babel/preset-env']
|
|
3
|
-
};
|
|
4
|
-
const cleanCssOpts = {
|
|
5
|
-
compatibility: 'ie8'
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
module.exports.html = function(gulp, gulpPlugins, siteSettings) {
|
|
9
|
-
return function() {
|
|
10
|
-
return gulp.src(siteSettings.tmpFolder + '/**/*.html')
|
|
11
|
-
.pipe(gulpPlugins.useref({
|
|
12
|
-
searchPath: [siteSettings.tmpFolder, './']
|
|
13
|
-
}))
|
|
14
|
-
.pipe(gulpPlugins.if('*.js', gulpPlugins.babel(babelOpts)))
|
|
15
|
-
.pipe(gulpPlugins.if('*.js', gulpPlugins.uglify()))
|
|
16
|
-
.pipe(gulpPlugins.if('*.css', gulpPlugins.cleanCss(cleanCssOpts)))
|
|
17
|
-
.pipe(gulpPlugins.if('*.css', gulpPlugins.csso()))
|
|
18
|
-
.pipe(gulpPlugins.revReplace())
|
|
19
|
-
.pipe(gulpPlugins.if('*.html', gulpPlugins.htmlmin({
|
|
20
|
-
collapseWhitespace: true,
|
|
21
|
-
minifyJS: {
|
|
22
|
-
mangle: false
|
|
23
|
-
}
|
|
24
|
-
})))
|
|
25
|
-
.pipe(gulp.dest(siteSettings.distFolder));
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
module.exports.css = function(gulp, gulpPlugins, siteSettings) {
|
|
30
|
-
return function() {
|
|
31
|
-
return gulp.src([siteSettings.tmpFolder + '/**/*.css', siteSettings.srcFolder + '/**/*.css'])
|
|
32
|
-
.pipe(gulpPlugins.cleanCss(cleanCssOpts))
|
|
33
|
-
.pipe(gulpPlugins.csso())
|
|
34
|
-
.pipe(gulp.dest(siteSettings.distFolder));
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
module.exports.js = function(gulp, gulpPlugins, siteSettings) {
|
|
39
|
-
return function() {
|
|
40
|
-
return gulp.src([siteSettings.srcFolder + '/**/*.js', '!' + siteSettings.srcFolder + '/data/**/*.js'])
|
|
41
|
-
.pipe(gulpPlugins.babel(babelOpts))
|
|
42
|
-
.pipe(gulpPlugins.uglify())
|
|
43
|
-
.on('error', function(err) {
|
|
44
|
-
console.log(err);
|
|
45
|
-
this.end();
|
|
46
|
-
})
|
|
47
|
-
.pipe(gulp.dest(siteSettings.distFolder));
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
module.exports.img = function() {
|
|
52
|
-
return function() {
|
|
53
|
-
return true;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
function imgMinByType(imgType, gulp, gulpPlugins, siteSettings) {
|
|
58
|
-
var srcPaths = [];
|
|
59
|
-
|
|
60
|
-
if (imgType === 'jpg') {
|
|
61
|
-
var imageminMozjpeg = require('imagemin-mozjpeg'),
|
|
62
|
-
imgExtMask = '{jpg,jpeg}',
|
|
63
|
-
imgMinSettings = [
|
|
64
|
-
imageminMozjpeg({
|
|
65
|
-
quality: 80
|
|
66
|
-
})
|
|
67
|
-
];
|
|
68
|
-
} else if (imgType === 'png') {
|
|
69
|
-
var imgExtMask = 'png',
|
|
70
|
-
imgMinSettings = [
|
|
71
|
-
gulpPlugins.imagemin.optipng({
|
|
72
|
-
optimizationLevel: 5
|
|
73
|
-
})
|
|
74
|
-
];
|
|
75
|
-
} else if (imgType === 'gif') {
|
|
76
|
-
var imgExtMask = 'gif',
|
|
77
|
-
imgMinSettings = [
|
|
78
|
-
gulpPlugins.imagemin.gifsicle({
|
|
79
|
-
interlaced: true
|
|
80
|
-
})
|
|
81
|
-
];
|
|
82
|
-
} else if (imgType === 'svg') {
|
|
83
|
-
var imgExtMask = 'svg',
|
|
84
|
-
imgMinSettings = [
|
|
85
|
-
gulpPlugins.imagemin.svgo()
|
|
86
|
-
];
|
|
87
|
-
} else if (imgType === 'webp') {
|
|
88
|
-
var imageminWebp = require('imagemin-webp'),
|
|
89
|
-
imgExtMask = 'webp',
|
|
90
|
-
imgMinSettings = [
|
|
91
|
-
imageminWebp({
|
|
92
|
-
quality: 80
|
|
93
|
-
})
|
|
94
|
-
];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
for (var i = 0; i < siteSettings.browserSyncServeFolders.length; i ++) {
|
|
98
|
-
srcPaths.push(siteSettings.browserSyncServeFolders[i] + '/' + siteSettings.imagesSubfolder + '/**/*.' + imgExtMask);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return function() {
|
|
102
|
-
return gulp.src(srcPaths)
|
|
103
|
-
.pipe(gulpPlugins.imagemin(imgMinSettings))
|
|
104
|
-
.on('error', function(err) {
|
|
105
|
-
console.log(err);
|
|
106
|
-
this.end();
|
|
107
|
-
})
|
|
108
|
-
.pipe(gulp.dest(siteSettings.distFolder + '/' + siteSettings.imagesSubfolder));
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
module.exports.imgJpg = function(gulp, gulpPlugins, siteSettings) {
|
|
113
|
-
return imgMinByType('jpg', gulp, gulpPlugins, siteSettings);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
module.exports.imgPng = function(gulp, gulpPlugins, siteSettings) {
|
|
117
|
-
return imgMinByType('png', gulp, gulpPlugins, siteSettings);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
module.exports.imgGif = function(gulp, gulpPlugins, siteSettings) {
|
|
121
|
-
return imgMinByType('gif', gulp, gulpPlugins, siteSettings);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
module.exports.imgSvg = function(gulp, gulpPlugins, siteSettings) {
|
|
125
|
-
return imgMinByType('svg', gulp, gulpPlugins, siteSettings);
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
module.exports.imgWebp = function(gulp, gulpPlugins, siteSettings) {
|
|
129
|
-
return imgMinByType('webp', gulp, gulpPlugins, siteSettings);
|
|
130
|
-
};
|
|
131
|
-
|
package/gulp-tasks/sass-lint.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
2
|
-
// Default sassLint settings
|
|
3
|
-
if ('undefined' === typeof siteSettings.sassLint) {
|
|
4
|
-
siteSettings.sassLint = {
|
|
5
|
-
configFile: './node_modules/mod-build/.sass-lint.yml'
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return function() {
|
|
10
|
-
gulp.src(siteSettings.srcFolder + '/styles/**/*.scss')
|
|
11
|
-
.pipe(gulpPlugins.sassLint(siteSettings.sassLint))
|
|
12
|
-
.pipe(gulpPlugins.sassLint.format())
|
|
13
|
-
.pipe(gulpPlugins.sassLint.failOnError());
|
|
14
|
-
};
|
|
15
|
-
};
|
package/gulp-tasks/serve.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// Serve site from src folder
|
|
2
|
-
module.exports.src = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
3
|
-
return function() {
|
|
4
|
-
var runSequence = require('run-sequence');
|
|
5
|
-
var sequenceOpts;
|
|
6
|
-
if (siteData.useTypescript) {
|
|
7
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'compile', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
8
|
-
} else if (siteData.isQSPage) {
|
|
9
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-theme-json', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
10
|
-
} else {
|
|
11
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-tooltips-json', 'combine-files', 'grab-images','grab-global-images', 'js-lint'];
|
|
12
|
-
}
|
|
13
|
-
runSequence(...sequenceOpts, () => {
|
|
14
|
-
// Run a BrowserSync server
|
|
15
|
-
gulpPlugins.browserSync({
|
|
16
|
-
notify: false,
|
|
17
|
-
port: 9000,
|
|
18
|
-
server: {
|
|
19
|
-
baseDir: siteSettings.browserSyncServeFolders,
|
|
20
|
-
routes: {
|
|
21
|
-
'/node_modules': 'node_modules'
|
|
22
|
-
},
|
|
23
|
-
middleware: function(req, res, next) {
|
|
24
|
-
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
25
|
-
next();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// If any assets have changed, reload the page
|
|
31
|
-
gulp.watch([
|
|
32
|
-
siteSettings.tmpFolder + '/**/*.html',
|
|
33
|
-
siteSettings.tmpFolder + '/' + siteSettings.fontsSubfolder + '/**/*',
|
|
34
|
-
siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/**/*.js',
|
|
35
|
-
siteSettings.srcFolder + '/' + siteSettings.imagesSubfolder + '/**/*'
|
|
36
|
-
]).on('change', gulpPlugins.browserSync.reload);
|
|
37
|
-
|
|
38
|
-
// If templates changed, rerun templates task
|
|
39
|
-
if (!siteData.useTypescript && !siteData.isQSPage) {
|
|
40
|
-
gulp.watch(siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/**/*.html', function() {
|
|
41
|
-
runSequence('templates','grab-global-images')
|
|
42
|
-
});
|
|
43
|
-
} else {
|
|
44
|
-
gulp.watch(siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/**/*.html', ['templates'])
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// If styles changed, rerun styles task
|
|
48
|
-
gulp.watch(siteSettings.srcFolder + '/' + siteSettings.stylesSubfolder + '/**/*.scss', ['styles']);
|
|
49
|
-
|
|
50
|
-
// If scripts changed, rerun js-lint task
|
|
51
|
-
gulp.watch([
|
|
52
|
-
siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/**/*.js',
|
|
53
|
-
siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/**/*.ts',
|
|
54
|
-
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsCompiledFolder + '**/*.js', // dont reload on compilation pipe
|
|
55
|
-
'gulpfile.babel.js',
|
|
56
|
-
'gulp-tasks/*.js'
|
|
57
|
-
], ['compile', 'js-lint']);
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// Serve site from dist folder
|
|
63
|
-
module.exports.dist = function(gulp, gulpPlugins, siteSettings) {
|
|
64
|
-
return function() {
|
|
65
|
-
// Run a BrowserSync server
|
|
66
|
-
gulpPlugins.browserSync({
|
|
67
|
-
notify: false,
|
|
68
|
-
port: 9000,
|
|
69
|
-
server: {
|
|
70
|
-
baseDir: [siteSettings.distFolder]
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
};
|
package/gulp-tasks/settings.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Settings for Gulp tasks (e.g. folder structure)
|
|
3
|
-
* @returns {Object} - folders
|
|
4
|
-
*/
|
|
5
|
-
module.exports = function() {
|
|
6
|
-
return {
|
|
7
|
-
tmpFolder: '.tmp',
|
|
8
|
-
srcFolder: 'src',
|
|
9
|
-
browserSyncServeFolders: ['.tmp', 'src', 'node_modules/mod-style-bootstrap/src', 'node_modules/mod-base/src'],
|
|
10
|
-
distFolder: 'dist',
|
|
11
|
-
fontsSubfolder: 'fonts',
|
|
12
|
-
imagesSubfolder: 'images',
|
|
13
|
-
stylesSubfolder: 'styles',
|
|
14
|
-
scriptsSubfolder: 'scripts',
|
|
15
|
-
scriptsCompiledFolder: 'scripts/compiled',
|
|
16
|
-
templatesSubfolder: 'templates',
|
|
17
|
-
dataSubfolder: 'data',
|
|
18
|
-
nodeEnv: process.env.NODE_ENV, // eslint-disable-line no-undef
|
|
19
|
-
isLocal: process.env.IS_LOCAL, // eslint-disable-line no-undef
|
|
20
|
-
buildPath: process.env.BUILD_PATH // eslint-disable-line no-undef
|
|
21
|
-
};
|
|
22
|
-
};
|
package/gulp-tasks/styles.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const sass = require('gulp-sass')(require('sass'));
|
|
2
|
-
|
|
3
|
-
module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
4
|
-
// Default autoprefixer settings
|
|
5
|
-
if ('undefined' === typeof siteSettings.autoprefixerBrowsers) {
|
|
6
|
-
siteSettings.autoprefixerBrowsers = [
|
|
7
|
-
'last 3 versions',
|
|
8
|
-
'ie >= 8',
|
|
9
|
-
'ios >= 7',
|
|
10
|
-
'android >= 4.4',
|
|
11
|
-
'bb >= 10'
|
|
12
|
-
];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const { isLocal, nodeEnv, buildPath } = siteSettings;
|
|
16
|
-
const { isWhiteLabel } = siteData;
|
|
17
|
-
let assetsPath = isLocal ? '/temp/assets' : 'https://' + nodeEnv + '/quote/resources/assets';
|
|
18
|
-
assetsPath = isWhiteLabel ? '' : assetsPath;
|
|
19
|
-
|
|
20
|
-
return function() {
|
|
21
|
-
return gulp.src(siteSettings.srcFolder + '/styles/**/*.scss')
|
|
22
|
-
.pipe(gulpPlugins.plumber())
|
|
23
|
-
.pipe(gulpPlugins.sourcemaps.init())
|
|
24
|
-
.pipe(gulpPlugins.sassVariables({
|
|
25
|
-
$path: assetsPath,
|
|
26
|
-
$buildPath: isLocal ? '' : buildPath
|
|
27
|
-
}))
|
|
28
|
-
.pipe(sass.sync({
|
|
29
|
-
outputStyle: 'expanded',
|
|
30
|
-
precision: 10,
|
|
31
|
-
includePaths: ['.']
|
|
32
|
-
}).on('error', sass.logError))
|
|
33
|
-
.pipe(gulpPlugins.autoprefixer({
|
|
34
|
-
browsers: siteSettings.autoprefixerBrowsers
|
|
35
|
-
}))
|
|
36
|
-
.pipe(gulpPlugins.sourcemaps.write())
|
|
37
|
-
.pipe(gulp.dest(siteSettings.tmpFolder + '/styles'))
|
|
38
|
-
.pipe(gulpPlugins.browserSync.reload({
|
|
39
|
-
stream: true
|
|
40
|
-
}));
|
|
41
|
-
};
|
|
42
|
-
};
|