mod-build 3.6.89-beta.2 → 3.6.89

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 CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## 3.6.89
4
4
 
5
- - Updated the `add-path-subdirectories` task to include path replacements for `../` or any variation of `../` in the src value.
5
+ - Updated the `add-path-subdirectories` task to include path replacements for `../` or any variation of `../` in the attribute replacement values.
6
+ - Updated the `grab-shared-scripts` task to only add the `${pathSubdirectory}` inside the JS files; as the `add-path-subdirectories` task will handle replacement of everything else
6
7
 
7
8
  ## 3.6.88
8
9
 
@@ -24,13 +24,13 @@ var componentFolderPath = '';
24
24
 
25
25
  function replaceModalyticsSrc(gulp, gulpPlugins, siteSettings, siteData) {
26
26
  const doNotIncludeSrc = siteData.siteData && siteData.siteData.isPathSubdirectory || siteData && siteData.isPathSubdirectory;
27
- const resourcePath = isQuotePageOrUseRelativePath ? `${pathSubdirectory}${doNotIncludeSrc ? '' : '{{#if this.src}}{{this.src}}{{/if}}'}resources/scripts/mod-alytics/` : '/resources/scripts/mod-alytics/';
27
+ const resourcePath = isQuotePageOrUseRelativePath ? `${doNotIncludeSrc ? '' : '{{#if this.src}}{{this.src}}{{/if}}'}resources/scripts/mod-alytics/` : '/resources/scripts/mod-alytics/';
28
28
  return gulp.src(`${siteSettings.srcFolder}/${componentFolderPath}/head/head.html`)
29
29
  .pipe(replace(/".*(modalytics).*"/, `"${resourcePath}${fileNames.modAlyticsFileName}"`))
30
30
  .pipe(gulp.dest(`${siteSettings.srcFolder}/${componentFolderPath}/head`));
31
31
  }
32
32
  function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
33
- const resourcePath = isQuotePageOrUseRelativePath ? `${pathSubdirectory}{{#if this.nodeModulesPath}}{{this.nodeModulesPath}}{{/if}}resources/scripts` : '/resources/scripts';
33
+ const resourcePath = isQuotePageOrUseRelativePath ? '{{#if this.nodeModulesPath}}{{this.nodeModulesPath}}{{/if}}resources/scripts' : '/resources/scripts';
34
34
  return gulp.src(`${siteSettings.srcFolder}/${componentFolderPath}/foot-assets/foot-assets.html`)
35
35
  .pipe(replace(/"(?:(?!"|js")[\s\S])+(modutils|mod-utils.*?)js"|"(?:(?!"|")[\s\S])+(callrail.*?)js"|"(?:(?!"|")[\s\S])+(footer\/footer-component.*?)js"|"(?:(?!"|")[\s\S])+(mod-form\/form.*?)js"/g, function(match) {
36
36
  if (match.includes('mod-form/form')) {
@@ -51,15 +51,15 @@ function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
51
51
  function replaceAbandonmentJsCssSrc(gulp, gulpPlugins, siteSettings, siteData) {
52
52
  const includeAccessibleFolder = useAccessibleComponents ? 'accessible/' : '';
53
53
  const abandonmentJsRegex = useAccessibleComponents ? /"(?:(?!"|")[\s\S])+(abandonment\/accessible\/abandonment.*?)js"/ : /"(?:(?!"|")[\s\S])+(abandonment\/abandonment.*?)js"/;
54
- const jsResourcePath = isQuotePageOrUseRelativePath ? `${pathSubdirectory}resources/scripts/abandonment/` : '/resources/scripts/abandonment/';
55
- const cssResourcePath = isQuotePageOrUseRelativePath ? `${pathSubdirectory}resources/styles/components/abandonment/` : '/resources/styles/components/abandonment/';
54
+ const jsResourcePath = (isQuotePageOrUseRelativePath ? '' : '/') + 'resources/scripts/abandonment/';
55
+ const cssResourcePath = (isQuotePageOrUseRelativePath ? '' : '/') + 'resources/styles/components/abandonment/';
56
56
  return gulp.src(siteSettings.srcFolder + '/templates/abandonment/*.html')
57
57
  .pipe(replace(abandonmentJsRegex, `"${jsResourcePath}${includeAccessibleFolder}${fileNames.abandonmentJsFileName}"`))
58
58
  .pipe(replace(/"(?:(?!"|")[\s\S])+(components\/abandonment\/abandonment.*?)css"/, `"${cssResourcePath}${fileNames.abandonmentStylesFileName}"`))
59
59
  .pipe(gulp.dest(siteSettings.srcFolder + '/templates/abandonment'));
60
60
  }
61
61
  function replaceFooterStylesReference(gulp, gulpPlugins, siteSettings, siteData) {
62
- if (siteData.siteData && siteData.siteData.useRelativePathForResources === true) {
62
+ if (isQuotePageOrUseRelativePath) {
63
63
  return gulp.src(siteSettings.srcFolder + '/resources/scripts/footer/' + fileNames.footerComponentJsFileName)
64
64
  .pipe(replace(/concat\((?:(?!concat\(|\))[\s\S])+(components\/footer\/mod.*?)\)/, `concat("${pathSubdirectory}resources/styles/components/footer/` + fileNames.modFooterStylesFileName + '")'))
65
65
  .pipe(replace(/concat\((?:(?!concat\(|\))[\s\S])+(components\/footer\/qs.*?)\)/, `concat("${pathSubdirectory}resources/styles/components/footer/` + fileNames.qsFooterStylesFileName + '")'))
@@ -72,7 +72,7 @@ function replaceFooterStylesReference(gulp, gulpPlugins, siteSettings, siteData)
72
72
  }
73
73
  }
74
74
  function replaceFooterStylesReferenceInMap(gulp, gulpPlugins, siteSettings, siteData) {
75
- if (siteData.siteData && siteData.siteData.useRelativePathForResources === true) {
75
+ if (isQuotePageOrUseRelativePath) {
76
76
  return gulp.src(siteSettings.srcFolder + '/resources/scripts/footer/footer-component.min.js.map')
77
77
  .pipe(replace(/\`(?:(?!\`|\`)[\s\S])+(components\/footer\/mod.*?)\`/, '`' + pathSubdirectory + 'resources/styles/components/footer/' + fileNames.modFooterStylesFileName + '`'))
78
78
  .pipe(replace(/\`(?:(?!\`|\`)[\s\S])+(components\/footer\/mod.*?)\`/, '`' + pathSubdirectory + 'resources/styles/components/footer/' + fileNames.qsFooterStylesFileName + '`'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.89-beta.2",
3
+ "version": "3.6.89",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",