mod-build 3.6.44-beta.3 → 3.6.44-beta.5

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.
@@ -1,18 +1,24 @@
1
1
  var replace = require('gulp-replace');
2
2
 
3
3
  module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
4
- if (siteData.siteData && siteData.siteData.pathSubdirectory || siteData && siteData.pathSubdirectory) {
5
- const pathSubdirectory = siteData.siteData && siteData.siteData.pathSubdirectory || siteData && siteData.pathSubdirectory;
6
-
7
- console.log(pathSubdirectory);
4
+ return function() {
5
+ if (siteData.siteData && siteData.siteData.pathSubdirectory || siteData && siteData.pathSubdirectory) {
6
+ const pathSubdirectory = siteData.siteData && siteData.siteData.pathSubdirectory || siteData && siteData.pathSubdirectory;
8
7
 
9
- return gulp.src(siteSettings.distFolder + '/**/*.html')
10
- .pipe(replace(/((src="|href=")(images|resources|scripts|styles|shared-components)\/[^"]+")/g, function(match, path) {
11
- if (path.startsWith('src="images') || path.startsWith('src="resources') || path.startsWith('src="scripts') || path.startsWith('src="shared-components') || path.startsWith('href="styles') || path.startsWith('href="shared-components')) {
12
- return path + '/spn/"';
13
- }
14
- return match;
15
- }))
16
- .pipe(gulp.dest(siteSettings.distFolder));
8
+ return gulp.src(siteSettings.distFolder + '/**/*.html')
9
+ .pipe(replace(/((src=")(images|scripts|shared-components)\/[^"]+")/g, function(match, path) {
10
+ if (path.startsWith('src="images') || path.startsWith('src="scripts') || path.startsWith('src="shared-components')) {
11
+ return `src="${pathSubdirectory}${path.slice(5)}`;
12
+ }
13
+ return match;
14
+ }))
15
+ .pipe(replace(/((href=")(images|styles|shared-components)\/[^"]+")/g, function(match, path) {
16
+ if (path.startsWith('href="images') || path.startsWith('href="styles') || path.startsWith('href="shared-components')) {
17
+ return `href="${pathSubdirectory}${path.slice(6)}`;
18
+ }
19
+ return match;
20
+ }))
21
+ .pipe(gulp.dest(siteSettings.distFolder));
22
+ }
17
23
  }
18
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.44-beta.3",
3
+ "version": "3.6.44-beta.5",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",