mod-build 3.6.3--beta.11 → 3.6.3--beta.12

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.
@@ -2,16 +2,15 @@ var request = require('request');
2
2
  var source = require('vinyl-source-stream');
3
3
  var replace = require('gulp-replace');
4
4
  var hash = require('gulp-hash');
5
- var filenames = require("gulp-filenames");
6
5
 
7
- function replaceModalyticsSrcInHead(gulp, gulpPlugins, siteSettings, siteData, result) {
6
+ function replaceModalyticsSrcInHead(gulp, gulpPlugins, siteSettings, siteData) {
8
7
  if (siteData.siteData && siteData.siteData.isQuotePage === true) {
9
8
  return gulp.src(siteSettings.srcFolder + '/shared-components/head/head.html')
10
- .pipe(replace(/".*(modalytics).*"/, `"resources/scripts/mod-alytics/${result}"`))
9
+ .pipe(replace(/".*(modalytics).*"/, '"resources/scripts/mod-alytics/modalytics.min.js"'))
11
10
  .pipe(gulp.dest(siteSettings.srcFolder + '/shared-components/head'));
12
11
  } else {
13
12
  return gulp.src(siteSettings.srcFolder + '/shared-components/head/head.html')
14
- .pipe(replace(/".*(modalytics).*"/, `"/resources/scripts/mod-alytics/${result}"`))
13
+ .pipe(replace(/".*(modalytics).*"/, '"/resources/scripts/mod-alytics/modalytics.min.js"'))
15
14
  .pipe(gulp.dest(siteSettings.srcFolder + '/shared-components/head'));
16
15
  }
17
16
  }
@@ -29,44 +28,28 @@ function copyCurrentModalytics(gulp, gulpPlugins, siteSettings, siteData) {
29
28
  hashLength: 20,
30
29
  template: 'modalytics-<%= hash %>.min.js'
31
30
  }))
32
- // .pipe(gulp.dest(`${siteSettings.srcFolder}/resources/scripts/mod-alytics`))
33
- .on('finish', function(e){
34
-
35
- console.log('finished!');
36
- });
31
+ .pipe(gulp.dest(`${siteSettings.srcFolder}/resources/scripts/mod-alytics`))
32
+ resolve()
33
+ })
34
+ .then(() => {
35
+ // copy over source map
36
+ return new Promise(resolve => {
37
+ request(`https://${siteSettings.nodeEnv}/quote/resources/mod-alytics/modalytics.min.js.map`)
38
+ .on('response', resp => {
39
+ if (resp.statusCode !== 200) {
40
+ throw new Error(`${resp.statusCode} Error while fetching modalytics.min.js.map`);
41
+ }
42
+ })
43
+ .pipe(source('modalytics.min.js.map'))
44
+ .pipe(gulp.dest(`${siteSettings.srcFolder}/resources/scripts/mod-alytics`))
45
+ .on('finish', resolve);
46
+ });
47
+ })
48
+ .then(() => {
49
+ console.log('supppp');
50
+ console.log(gulp.src(`${siteSettings.srcFolder}/resources/scripts/mod-alytics/*.min.js`));
37
51
  })
38
- // .then((result) => {
39
- // // copy over main file
40
- // return new Promise(resolve => {
41
- // request(`https://${siteSettings.nodeEnv}/quote/resources/mod-alytics/${result}`)
42
- // .on('response', resp => {
43
- // if (resp.statusCode !== 200) {
44
- // throw new Error(`${resp.statusCode} Error while fetching ${result}`);
45
- // } else {
46
- // replaceModalyticsSrcInHead(gulp, gulpPlugins, siteSettings, siteData, result);
47
- // }
48
- // })
49
- // .pipe(source(result))
50
- // .pipe(gulp.dest(`${siteSettings.srcFolder}/resources/scripts/mod-alytics`))
51
- // resolve(result)
52
- // });
53
- // })
54
- // .then((result) => {
55
- // // copy over source map
56
- // return new Promise(resolve => {
57
- // request(`https://${siteSettings.nodeEnv}/quote/resources/mod-alytics/${result}.map`)
58
- // .on('response', resp => {
59
- // if (resp.statusCode !== 200) {
60
- // throw new Error(`${resp.statusCode} Error while fetching ${result}`);
61
- // }
62
- // })
63
- // .pipe(source(`${result}.map`))
64
- // .pipe(gulp.dest(`${siteSettings.srcFolder}/resources/scripts/mod-alytics`))
65
- // .on('finish', resolve);
66
- // });
67
- // });
68
52
  }
69
-
70
53
  module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
71
54
  return function() {
72
55
  const { nodeEnv } = siteSettings;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.3--beta.11",
3
+ "version": "3.6.3--beta.12",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -23,10 +23,8 @@
23
23
  "gulp-csso": "^3.0.0",
24
24
  "gulp-eslint": "^5.0.0",
25
25
  "gulp-eslint-threshold": "^0.1.1",
26
- "gulp-filenames": "^4.0.1",
27
26
  "gulp-filter": "^5.0.0",
28
27
  "gulp-handlebars-file-include": "^1.0.0",
29
- "gulp-hash": "^4.2.2",
30
28
  "gulp-htmlmin": "^3.0.0",
31
29
  "gulp-if": "^2.0.2",
32
30
  "gulp-imagemin": "^3.2.0",
@@ -46,6 +44,7 @@
46
44
  "gulp-sass-variables": "^1.2.0",
47
45
  "gulp-size": "^2.1.0",
48
46
  "gulp-sourcemaps": "^2.6.0",
47
+ "gulp-tap": "^2.0.0",
49
48
  "gulp-uglify": "^2.1.2",
50
49
  "gulp-useref": "^5.0.0",
51
50
  "husky": "^1.3.1",