mod-build 3.6.44-beta.4 → 3.6.44-beta.6
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.
|
@@ -5,18 +5,19 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
5
5
|
if (siteData.siteData && siteData.siteData.pathSubdirectory || siteData && siteData.pathSubdirectory) {
|
|
6
6
|
const pathSubdirectory = siteData.siteData && siteData.siteData.pathSubdirectory || siteData && siteData.pathSubdirectory;
|
|
7
7
|
|
|
8
|
-
console.log(pathSubdirectory);
|
|
9
|
-
|
|
10
8
|
return gulp.src(siteSettings.distFolder + '/**/*.html')
|
|
9
|
+
.pipe(replace(/(href="favicon.ico")/g, function(match, path) {
|
|
10
|
+
return `href="${pathSubdirectory}favicon.ico"`;
|
|
11
|
+
}))
|
|
11
12
|
.pipe(replace(/((src=")(images|scripts|shared-components)\/[^"]+")/g, function(match, path) {
|
|
12
13
|
if (path.startsWith('src="images') || path.startsWith('src="scripts') || path.startsWith('src="shared-components')) {
|
|
13
|
-
return
|
|
14
|
+
return `src="${pathSubdirectory}${path.slice(5)}`;
|
|
14
15
|
}
|
|
15
16
|
return match;
|
|
16
17
|
}))
|
|
17
18
|
.pipe(replace(/((href=")(images|styles|shared-components)\/[^"]+")/g, function(match, path) {
|
|
18
19
|
if (path.startsWith('href="images') || path.startsWith('href="styles') || path.startsWith('href="shared-components')) {
|
|
19
|
-
return
|
|
20
|
+
return `href="${pathSubdirectory}${path.slice(6)}`;
|
|
20
21
|
}
|
|
21
22
|
return match;
|
|
22
23
|
}))
|
package/gulp-tasks/tasks.js
CHANGED
|
@@ -446,15 +446,15 @@ module.exports = function() {
|
|
|
446
446
|
}
|
|
447
447
|
},
|
|
448
448
|
|
|
449
|
-
// If siteData.pathSubdirectory exists...append the directory path to all of the existing
|
|
450
|
-
'
|
|
449
|
+
// If siteData.pathSubdirectory exists...append the directory path to all of the existing RELATIVE URL paths
|
|
450
|
+
'add-path-subdirectories': {
|
|
451
451
|
subtasks: [],
|
|
452
452
|
func: function(opts) {
|
|
453
453
|
if ('undefined' === typeof opts.gulpTasksFolderPath) {
|
|
454
454
|
opts.gulpTasksFolderPath = '.';
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
return require(opts.gulpTasksFolderPath + '/
|
|
457
|
+
return require(opts.gulpTasksFolderPath + '/add-path-subdirectories')(opts.gulp, opts.gulpPlugins, opts.gulpSettings, opts.siteData);
|
|
458
458
|
}
|
|
459
459
|
},
|
|
460
460
|
|