mod-build 4.0.34 → 4.0.35
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 +1 -1
- package/tasks/grab-shared-scripts.js +33 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -95,6 +95,7 @@ const TASKS = {
|
|
|
95
95
|
config: {
|
|
96
96
|
fileName: 'modUtilsFileName',
|
|
97
97
|
dest: 'scripts/mod-utils',
|
|
98
|
+
hasMapFile: true
|
|
98
99
|
},
|
|
99
100
|
srcReplaceFn: null,
|
|
100
101
|
},
|
|
@@ -103,6 +104,7 @@ const TASKS = {
|
|
|
103
104
|
config: {
|
|
104
105
|
fileName: 'callrailFileName',
|
|
105
106
|
dest: 'scripts/callrail',
|
|
107
|
+
hasMapFile: true
|
|
106
108
|
},
|
|
107
109
|
srcReplaceFn: null,
|
|
108
110
|
},
|
|
@@ -111,6 +113,7 @@ const TASKS = {
|
|
|
111
113
|
config: {
|
|
112
114
|
fileName: 'footerComponentJsFileName',
|
|
113
115
|
dest: 'scripts/footer',
|
|
116
|
+
hasMapFile: true
|
|
114
117
|
},
|
|
115
118
|
srcReplaceFn: null,
|
|
116
119
|
},
|
|
@@ -119,6 +122,7 @@ const TASKS = {
|
|
|
119
122
|
config: {
|
|
120
123
|
fileName: 'homeownerFormFileName',
|
|
121
124
|
dest: 'scripts/mod-form/form',
|
|
125
|
+
hasMapFile: true
|
|
122
126
|
},
|
|
123
127
|
srcReplaceFn: replaceFootAssetScripts,
|
|
124
128
|
},
|
|
@@ -127,6 +131,7 @@ const TASKS = {
|
|
|
127
131
|
config: {
|
|
128
132
|
fileName: 'contractorFormFileName',
|
|
129
133
|
dest: 'scripts/mod-form/form',
|
|
134
|
+
hasMapFile: true
|
|
130
135
|
},
|
|
131
136
|
srcReplaceFn: null,
|
|
132
137
|
},
|
|
@@ -135,6 +140,7 @@ const TASKS = {
|
|
|
135
140
|
config: {
|
|
136
141
|
fileName: 'modAlyticsFileName',
|
|
137
142
|
dest: 'scripts/mod-alytics',
|
|
143
|
+
hasMapFile: true
|
|
138
144
|
},
|
|
139
145
|
srcReplaceFn: replaceModalyticsSrc,
|
|
140
146
|
},
|
|
@@ -142,7 +148,7 @@ const TASKS = {
|
|
|
142
148
|
url: 'shared-resources/styles/components/abandonment/abandonment.min.css',
|
|
143
149
|
config: {
|
|
144
150
|
fileName: 'abandonmentStylesFileName',
|
|
145
|
-
dest: 'styles/components/abandonment'
|
|
151
|
+
dest: 'styles/components/abandonment'
|
|
146
152
|
},
|
|
147
153
|
srcReplaceFn: null,
|
|
148
154
|
},
|
|
@@ -151,6 +157,7 @@ const TASKS = {
|
|
|
151
157
|
config: {
|
|
152
158
|
fileName: 'abandonmentJsFileName',
|
|
153
159
|
dest: 'scripts/abandonment',
|
|
160
|
+
hasMapFile: true
|
|
154
161
|
},
|
|
155
162
|
srcReplaceFn: replaceAbandonmentJsCssSrc,
|
|
156
163
|
},
|
|
@@ -158,7 +165,7 @@ const TASKS = {
|
|
|
158
165
|
url: 'shared-resources/styles/components/footer/mod-footer.min.css',
|
|
159
166
|
config: {
|
|
160
167
|
fileName: 'modFooterStylesFileName',
|
|
161
|
-
dest: 'styles/components/footer'
|
|
168
|
+
dest: 'styles/components/footer'
|
|
162
169
|
},
|
|
163
170
|
srcReplaceFn: null,
|
|
164
171
|
},
|
|
@@ -166,7 +173,7 @@ const TASKS = {
|
|
|
166
173
|
url: 'shared-resources/styles/components/footer/qs-footer.min.css',
|
|
167
174
|
config: {
|
|
168
175
|
fileName: 'qsFooterStylesFileName',
|
|
169
|
-
dest: 'styles/components/footer'
|
|
176
|
+
dest: 'styles/components/footer'
|
|
170
177
|
},
|
|
171
178
|
srcReplaceFn: replaceFooterStylesReference,
|
|
172
179
|
}
|
|
@@ -227,6 +234,29 @@ function getResource(task, fileNames, resourcePath = 'quote/resources') {
|
|
|
227
234
|
})
|
|
228
235
|
});
|
|
229
236
|
})
|
|
237
|
+
.then(() => {
|
|
238
|
+
if (!config.hasMapFile) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const mapFileUrl = `${url}.map`;
|
|
243
|
+
const mapFile = getFileFromURL(mapFileUrl);
|
|
244
|
+
|
|
245
|
+
return axiosInstance({
|
|
246
|
+
url: `https://${task.config.defaultSettings.nodeEnv}/${resourcePath}/${mapFileUrl}`,
|
|
247
|
+
method: 'get',
|
|
248
|
+
responseType: 'stream'
|
|
249
|
+
}).then(resp => {
|
|
250
|
+
if (resp.status !== 200) {
|
|
251
|
+
throw new Error(`${resp.status}: Error while fetching map file ${mapFileUrl}`);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const mapWriter = createWriteStream(`${task.config.defaultSettings.publicFolder}/resources/${config.dest}/${mapFile}`);
|
|
255
|
+
resp.data.pipe(mapWriter);
|
|
256
|
+
console.log(`${task.config.defaultSettings.publicFolder}/resources/${config.dest}/${mapFile} created...`);
|
|
257
|
+
return finished(mapWriter);
|
|
258
|
+
});
|
|
259
|
+
})
|
|
230
260
|
.then(() => {
|
|
231
261
|
if (!srcReplaceFn) {
|
|
232
262
|
return false;
|