amphora-html 6.0.0-1 → 6.0.0-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.
Files changed (87) hide show
  1. package/.envrc +1 -1
  2. package/lib/media.js +7 -22
  3. package/lib/media.test.js +112 -1
  4. package/package.json +2 -1
  5. package/.vscode/.history/amphora-html/lib/media_20210422170004.js +0 -418
  6. package/.vscode/.history/amphora-html/lib/media_20210423114100.js +0 -419
  7. package/.vscode/.history/amphora-html/lib/media_20210423114125.js +0 -420
  8. package/.vscode/.history/amphora-html/lib/media_20210423121821.js +0 -420
  9. package/.vscode/.history/amphora-html/lib/media_20210423121839.js +0 -420
  10. package/.vscode/.history/amphora-html/lib/media_20210423133939.js +0 -420
  11. package/.vscode/.history/amphora-html/lib/media_20210423143343.js +0 -420
  12. package/.vscode/.history/amphora-html/lib/media_20210423143445.js +0 -420
  13. package/.vscode/.history/amphora-html/lib/media_20210430141402.js +0 -423
  14. package/.vscode/.history/amphora-html/lib/media_20210430142038.js +0 -432
  15. package/.vscode/.history/amphora-html/lib/media_20210430142153.js +0 -434
  16. package/.vscode/.history/amphora-html/lib/media_20210430142400.js +0 -434
  17. package/.vscode/.history/amphora-html/lib/media_20210430142437.js +0 -436
  18. package/.vscode/.history/amphora-html/lib/media_20210430142934.js +0 -436
  19. package/.vscode/.history/amphora-html/lib/media_20210430143110.js +0 -437
  20. package/.vscode/.history/amphora-html/lib/media_20210430143347.js +0 -441
  21. package/.vscode/.history/amphora-html/lib/media_20210430143354.js +0 -441
  22. package/.vscode/.history/amphora-html/lib/media_20210430143517.js +0 -442
  23. package/.vscode/.history/amphora-html/lib/media_20210430143831.js +0 -446
  24. package/.vscode/.history/amphora-html/lib/media_20210430144135.js +0 -446
  25. package/.vscode/.history/amphora-html/lib/media_20210430144206.js +0 -447
  26. package/.vscode/.history/amphora-html/lib/media_20210430144435.js +0 -458
  27. package/.vscode/.history/amphora-html/lib/media_20210503102940.js +0 -449
  28. package/.vscode/.history/amphora-html/lib/media_20210503103055.js +0 -435
  29. package/.vscode/.history/amphora-html/lib/media_20210503105800.js +0 -435
  30. package/.vscode/.history/amphora-html/lib/media_20210503115000.js +0 -435
  31. package/.vscode/.history/amphora-html/lib/media_20210503120729.js +0 -455
  32. package/.vscode/.history/amphora-html/lib/media_20210503120737.js +0 -455
  33. package/.vscode/.history/amphora-html/lib/media_20210503120859.js +0 -455
  34. package/.vscode/.history/amphora-html/lib/media_20210503121446.js +0 -455
  35. package/.vscode/.history/amphora-html/lib/media_20210503123023.js +0 -455
  36. package/.vscode/.history/amphora-html/lib/media_20210503123146.js +0 -435
  37. package/.vscode/.history/amphora-html/lib/media_20210503123207.js +0 -435
  38. package/.vscode/.history/amphora-html/lib/media_20210503123232.js +0 -458
  39. package/.vscode/.history/amphora-html/lib/media_20210503123433.js +0 -435
  40. package/.vscode/.history/amphora-html/lib/media_20210503124026.js +0 -435
  41. package/.vscode/.history/amphora-html/lib/media_20210503124152.js +0 -444
  42. package/.vscode/.history/amphora-html/lib/media_20210503124256.js +0 -455
  43. package/.vscode/.history/amphora-html/lib/media_20210503124650.js +0 -462
  44. package/.vscode/.history/amphora-html/lib/media_20210503124855.js +0 -453
  45. package/.vscode/.history/amphora-html/lib/media_20210503130202.js +0 -453
  46. package/.vscode/.history/amphora-html/lib/media_20210503130230.js +0 -453
  47. package/.vscode/.history/amphora-html/lib/media_20210503130932.js +0 -456
  48. package/.vscode/.history/amphora-html/lib/media_20210503131700.js +0 -457
  49. package/.vscode/.history/amphora-html/lib/media_20210503131800.js +0 -457
  50. package/.vscode/.history/amphora-html/lib/media_20210503131943.js +0 -457
  51. package/.vscode/.history/amphora-html/lib/media_20210503132029.js +0 -457
  52. package/.vscode/.history/amphora-html/lib/media_20210503135814.js +0 -457
  53. package/.vscode/.history/amphora-html/lib/media_20210503140648.js +0 -457
  54. package/.vscode/.history/amphora-html/lib/media_20210503161154.js +0 -427
  55. package/.vscode/.history/amphora-html/lib/media_20210503161242.js +0 -427
  56. package/.vscode/.history/amphora-html/lib/media_20210503165324.js +0 -427
  57. package/.vscode/.history/amphora-html/lib/media_20210503171517.js +0 -427
  58. package/.vscode/.history/amphora-html/lib/media_20210503173501.js +0 -427
  59. package/.vscode/.history/amphora-html/lib/media_20210504114616.js +0 -427
  60. package/.vscode/.history/amphora-html/lib/media_20210504121950.js +0 -427
  61. package/.vscode/.history/amphora-html/lib/media_20210504122005.js +0 -427
  62. package/.vscode/.history/amphora-html/lib/media_20210504122119.js +0 -427
  63. package/.vscode/.history/amphora-html/lib/media_20210504122215.js +0 -427
  64. package/.vscode/.history/amphora-html/lib/media_20210504161319.js +0 -427
  65. package/.vscode/.history/amphora-html/lib/media_20210504163440.js +0 -427
  66. package/.vscode/.history/amphora-html/lib/media_20210505105706.js +0 -427
  67. package/.vscode/.history/amphora-html/lib/media_20210505112458.js +0 -427
  68. package/.vscode/.history/amphora-html/lib/media_20210511135806.js +0 -434
  69. package/.vscode/.history/amphora-html/lib/media_20210512105948.js +0 -434
  70. package/.vscode/.history/amphora-html/lib/media_20210512110245.js +0 -434
  71. package/.vscode/.history/amphora-html/lib/media_20210512114913.js +0 -434
  72. package/.vscode/.history/amphora-html/lib/media_20210512114917.js +0 -434
  73. package/.vscode/.history/amphora-html/lib/media_20210512122725.js +0 -429
  74. package/.vscode/.history/amphora-html/lib/media_20210512123057.js +0 -429
  75. package/.vscode/.history/amphora-html/lib/media_20210512123102.js +0 -429
  76. package/.vscode/.history/amphora-html/lib/media_20210512123201.js +0 -429
  77. package/.vscode/.history/amphora-html/lib/media_20210512152244.js +0 -429
  78. package/.vscode/.history/amphora-html/lib/media_20210512152536.js +0 -433
  79. package/.vscode/.history/amphora-html/lib/media_20210512152541.js +0 -433
  80. package/.vscode/.history/amphora-html/lib/media_20210512152717.js +0 -433
  81. package/.vscode/.history/amphora-html/lib/media_20210512152931.js +0 -419
  82. package/.vscode/.history/amphora-html/lib/media_20210512152949.js +0 -420
  83. package/.vscode/.history/amphora-html/lib/media_20210512152958.js +0 -418
  84. package/.vscode/.history/amphora-html/lib/media_20210512155619.js +0 -418
  85. package/.vscode/.history/amphora-html/lib/media_20210512164028.js +0 -418
  86. package/.vscode/.history/amphora-html/lib/media_20210512170157.js +0 -418
  87. package/.vscode/.history/amphora-html/lib/media_20210512171030.js +0 -418
@@ -1,457 +0,0 @@
1
- 'use strict';
2
-
3
- const _ = require('lodash'),
4
- path = require('path'),
5
- files = require('nymag-fs'),
6
- bluebird = require('bluebird'),
7
- setup = require('./setup'),
8
- styleguide = require('./styleguide'),
9
- STYLE_TAG = 'style',
10
- SCRIPT_TAG = 'scripts',
11
- ASYNC_SCRIPT_TAG = 'async',
12
- DEFER_SCRIPT_TAG = 'defer',
13
- ASYNC_DEFER_SCRIPT_TAG = 'async-defer',
14
- MEDIA_DIRECTORY = path.join(process.cwd(), 'public');
15
-
16
- /**
17
- * @param {string} str
18
- * @returns {number}
19
- */
20
- function findBottom(str) {
21
- var index = str.lastIndexOf('</body>');
22
-
23
- if (index === -1) {
24
- index = str.lastIndexOf('</');
25
- }
26
-
27
- return index;
28
- }
29
-
30
- /**
31
- * @param {string} str
32
- * @returns {number}
33
- */
34
- function findTop(str) {
35
- var index = str.indexOf('</head>');
36
-
37
- if (index === -1) {
38
- index = str.indexOf('>') + 1;
39
- }
40
- return index;
41
- }
42
-
43
- /**
44
- * Put items at index in the very large target string.
45
- *
46
- * @param {string} str
47
- * @param {number} index
48
- * @param {[string]} items
49
- * @returns {string}
50
- */
51
- function splice(str, index, items) {
52
- return str.substr(0, index) + items + str.substr(index);
53
- }
54
-
55
- /**
56
- * Get the contents of a string that come after specified characters.
57
- *
58
- * @param {string} str Any string to split
59
- * @param {string} dir The directory the file is in
60
- * @return {string}
61
- */
62
- function getFileName(str, dir) {
63
- return str.split(dir)[1];
64
- }
65
-
66
- /**
67
- * Retrieve the contents of a file
68
- *
69
- * @param {array} fileArray An array of file names
70
- * @param {string} targetDir The directory to retrieve files from
71
- * @param {string} filePrefix The string that comes right before the file name
72
- * @return {Promise}
73
- */
74
- function getContentsOfFiles(fileArray, targetDir, filePrefix) {
75
- var allPromises = [],
76
- currentDir = process.cwd();
77
-
78
- fileArray.forEach(file => {
79
- allPromises.push(files.readFilePromise(path.join(currentDir, targetDir, getFileName(file, filePrefix))));
80
- });
81
-
82
- return Promise.all(allPromises)
83
- .catch(err => {
84
- throw err;
85
- });
86
- }
87
-
88
- /**
89
- * Wraps a string with HTML tags
90
- * @param {string} string The string to wrap
91
- * @param {string} tag The HTML tag to use
92
- * @return {string}
93
- */
94
- function wrapWithTags(string, tag) {
95
- if (tag === SCRIPT_TAG) {
96
- return `<script type="text/javascript">
97
- // <![CDATA[
98
- ${string}
99
- // ]]
100
- </script>`;
101
- } else {
102
- return `<style>${string}</style>`;
103
- }
104
- }
105
-
106
- /**
107
- * Concatenates an array of files into one string.
108
- *
109
- * @param {array} fileArray An array of files
110
- * @param {string} directory The directory in which `fs` will look for the file
111
- * @param {string} filePrefix The directory path before the filename
112
- * @param {string|null} tag The type of tag to wrap the contents in.
113
- * @return {string}
114
- */
115
- function combineFileContents(fileArray, directory, filePrefix, tag) {
116
- if (!fileArray || !fileArray.length) {
117
- return false;
118
- }
119
-
120
- // If there are files, retrieve contents
121
- return getContentsOfFiles(fileArray, directory, filePrefix)
122
- .then(function (fileContents) {
123
- return wrapWithTags(fileContents.join(''), tag);
124
- });
125
- }
126
-
127
- /**
128
- * Append at the bottom of the head tag, or if no head tag, then the top of root tag.
129
- *
130
- * @param {array} styles
131
- * @param {string} html
132
- * @returns {string}
133
- */
134
- function appendMediaToTop(styles, html) {
135
- var index = findTop(html);
136
-
137
- return splice(html, index, styles);
138
- }
139
-
140
- /**
141
- * Append at the bottom of the body tag, or if no body tag, then the bottom of the root tag.
142
- * @param {Array} scripts
143
- * @param {string} html
144
- * @returns {string}
145
- */
146
- function appendMediaToBottom(scripts, html) {
147
- var index = findBottom(html);
148
-
149
- return splice(html, index, scripts);
150
- }
151
-
152
- function injectTags(fileArray, site, tag) {
153
- var buster = module.exports.cacheBuster ? `?version=${module.exports.cacheBuster}` : '';
154
-
155
- return bluebird.resolve(_.map(fileArray, function (file) {
156
- if (tag === STYLE_TAG) {
157
- return `<link rel="stylesheet" type="text/css" href="${file}${buster}">`;
158
- } else if (tag === ASYNC_SCRIPT_TAG) {
159
- return `<script async crossorigin="anonymous" src="${file}" type="text/javascript"></script>`;
160
- } else if (tag === DEFER_SCRIPT_TAG) {
161
- return `<script defer crossorigin="anonymous" src="${file}" type="text/javascript"></script>`;
162
- } else if (tag === ASYNC_DEFER_SCRIPT_TAG) {
163
- return `<script async defer crossorigin="anonymous" src="${file}" type="text/javascript"></script>`;
164
- } else {
165
- return `<script crossorigin="anonymous" type="text/javascript" src="${file}${buster}"></script>`;
166
- }
167
- }).join('\n'));
168
- }
169
-
170
- /**
171
- * Gets a list of all css and js needed for the components listed.
172
- * @param {Object} state
173
- * @returns {{styles: Array, scripts: Array}}
174
- */
175
- function getMediaMap(state) {
176
- return {
177
- styles: module.exports.getStyleFiles(state),
178
- scripts: module.exports.getScriptFiles(state)
179
- };
180
- }
181
-
182
- /* eslint-disable complexity */
183
- /**
184
- * Get the proper styles for the component. If a styleguide is configured, use
185
- * that css. Defaults to the site slug
186
- *
187
- * @param {Object} state
188
- * @returns {array}
189
- */
190
- function getStyleFiles(state) {
191
- const { site } = state.locals,
192
- assetDir = site && site.assetDir || MEDIA_DIRECTORY,
193
- assetPath = site && site.assetPath || '',
194
- assetHost = site && site.assetHost || '',
195
- siteStyleguide = site && site.styleguide,
196
- layoutName = _.get(state, '_layoutData.name');
197
- let cssFilePaths = [], layoutBasePath;
198
-
199
- // legacy behavior: load <component>.css and <component>.<site>.css
200
- if (!site.styleguide) {
201
- const siteSlug = site && site.slug;
202
-
203
- cssFilePaths = state._components
204
- .reduce((acc, curr) => {
205
- acc.push(
206
- path.join(assetDir, 'css', `${curr}.css`),
207
- path.join(assetDir, 'css', `${curr}.${siteSlug}.css`)
208
- );
209
- return acc;
210
- }, []);
211
- // in edit mode, grab all variations
212
- } else if (state.locals.edit) {
213
- const availableVariations = styleguide.getVariations(siteStyleguide);
214
-
215
- cssFilePaths = state._components
216
- .reduce((acc, cmptName) => {
217
- acc.push(cmptName, ...availableVariations[cmptName] || []);
218
- return acc;
219
- }, [])
220
- .map(baseName => {
221
- const basePath = path.join(assetDir, 'css', `${baseName}.${siteStyleguide}.css`);
222
-
223
- return files.fileExists(basePath) ?
224
- basePath :
225
- path.join(assetDir, 'css', `${baseName}._default.css`);
226
- });
227
- // in view mode, grab only used variations
228
- } else if (state._usedVariations) {
229
- cssFilePaths = state._usedVariations
230
- .map(variation => {
231
- const styleguideVariationPath = path.join(assetDir, 'css', `${variation}.${siteStyleguide}.css`);
232
-
233
- return files.fileExists(styleguideVariationPath) ?
234
- styleguideVariationPath :
235
- path.join(assetDir, 'css', `${variation}._default.css`);
236
- });
237
- }
238
-
239
- // add the layout css
240
- if (layoutName) {
241
- layoutBasePath = path.join(assetDir, 'css', `${layoutName}.${siteStyleguide}.css`);
242
-
243
- if (files.fileExists(layoutBasePath)) {
244
- cssFilePaths.push(layoutBasePath);
245
- } else {
246
- cssFilePaths.push(path.join(assetDir, 'css', `${layoutName}._default.css`));
247
- }
248
- }
249
-
250
- return cssFilePaths
251
- .filter(files.fileExists)
252
- .map(pathJoin(assetHost, assetPath, assetDir));
253
- }
254
- /* eslint-enable complexity */
255
-
256
- /**
257
- * Get the proper scripts for the component
258
- *
259
- * @param {string} name
260
- * @param {object} site
261
- * @returns {array}
262
- */
263
-
264
- function getScriptFiles(state) {
265
- const site = state.locals.site,
266
- slug = site.slug,
267
- assetDir = site && site.assetDir || MEDIA_DIRECTORY,
268
- assetPath = site && site.assetPath || '',
269
- assetHost = site && site.assetHost || '';
270
-
271
- return state._components
272
- .reduce((prev, name) => {
273
- prev.push(
274
- path.join(assetDir, 'js', `${name}.js`),
275
- path.join(assetDir, 'js', `${name}.${slug}.js`),
276
- path.join(assetDir, 'js', `${name}.client.js`)
277
- );
278
- return prev;
279
- }, [])
280
- .filter(files.fileExists)
281
- .map(pathJoin(assetHost, assetPath, assetDir));
282
- }
283
-
284
- /**
285
- * Read the asset manifest generated by the `clay pack` bundling command and
286
- * check for scripts which match the rendered component names. The manifest for
287
- * each asset lists its complete set of dependencies, so we dedupe them.
288
- * Downstream globals and Webpack's runtime are added to the beginning of the
289
- * list, Clay CLI's initializer to the end.
290
- *
291
- * @param {Object} state - Amphora's render state.
292
- * @return {string[]} A list of component assets.
293
- */
294
- function getManifestScripts(state) {
295
- const site = state.locals.site,
296
- assetDir = site && site.assetDir || MEDIA_DIRECTORY,
297
- assetHost = site && site.assetHost || '/',
298
- manifestName = site && site.manifestName || 'public/assets-manifest.json',
299
- manifestFile = path.resolve(path.join(assetDir, manifestName)),
300
- manifest = files.tryRequire(manifestFile);
301
-
302
- if (!manifest) return [];
303
-
304
- const componentsAndDependencies = state._components.reduce((acc, component) => {
305
- const allDependencies = _.get(manifest, ['entrypoints', component, 'assets', 'js'], []),
306
- componentScripts = allDependencies.filter(script => script.includes(component)),
307
- dependencyScripts = _.without(allDependencies, componentScripts);
308
-
309
- acc.components = acc.components.concat(componentScripts);
310
- acc.dependencies = acc.dependencies.concat(dependencyScripts);
311
- return acc;
312
- }, {
313
- components: [],
314
- dependencies: [],
315
- });
316
-
317
- const runtime = _.get(manifest, 'runtime.js', '');
318
- const globalScripts = _.get(manifest, 'entrypoints.__clay_globals.assets.js', []);
319
- const initScripts = _.get(manifest, 'entrypoints.__clay_client_init.assets.js', []);
320
-
321
- const scripts = {
322
- components: [
323
- ...componentsAndDependencies.dependencies,
324
- ...componentsAndDependencies.components
325
- ],
326
- global: globalScripts,
327
- init: initScripts,
328
- runtime: [runtime],
329
- };
330
-
331
- const scriptsWithHost = _.mapValues(scripts, list => {
332
- const realList = list && list.filter(Boolean)
333
-
334
- if (!realList || !realList.length) return [];
335
-
336
- return Array.from(new Set(realList))
337
- .map(script => path.join(assetHost, script));
338
- });
339
-
340
- return scriptsWithHost;
341
- }
342
-
343
- /**
344
- * Trim the path on the file system bythe link of the
345
- * asset directory and then join it with either the assetHost
346
- * value of the site or the assetPath value (found in the
347
- * site's config file)
348
- *
349
- * @param {String} assetHost
350
- * @param {String} assetPath
351
- * @param {String} assetDir
352
- * @return {Function}
353
- */
354
- function pathJoin(assetHost, assetPath, assetDir) {
355
- var assetDirLen = assetDir.length;
356
-
357
- return function (filePath) {
358
- var pathToFile = filePath.substr(assetDirLen);
359
-
360
- if (assetHost) return `${assetHost}${pathToFile}`;
361
- return path.join(assetPath, pathToFile);
362
- };
363
- }
364
-
365
- /**
366
- * Set the values for inlining vs tagging edit mode styles/scripts
367
- *
368
- * @param {object|boolean} options
369
- * @param {string} [cacheBuster]
370
- */
371
- function configure(options, cacheBuster = '') {
372
- if (options && _.isObject(options)) {
373
- module.exports.editStylesTags = options.styles || false;
374
- module.exports.editScriptsTags = options.scripts || false;
375
- } else {
376
- module.exports.editStylesTags = options;
377
- module.exports.editScriptsTags = options;
378
- }
379
- // Assign cacheBuster
380
- module.exports.cacheBuster = cacheBuster;
381
- }
382
-
383
- /**
384
- * Given the state and html string...
385
- *
386
- * 1. Find all associated scripts/styles
387
- * 2. Run `resolveMedia`
388
- * 3. Stitch in the assets' contents
389
- * 4. Return the HTML string
390
- *
391
- * @param {Object} state
392
- * @return {Function}
393
- */
394
- function injectScriptsAndStyles(state) {
395
- const { locals } = state;
396
-
397
- return function (html) {
398
- var mediaMap = {};
399
-
400
- // Check that HTML is string
401
- if (typeof html !== 'string') {
402
- throw new Error('Missing html parameter');
403
- }
404
-
405
- // We've got a string so let's actually get the map of styles
406
- mediaMap = module.exports.getMediaMap(state);
407
-
408
- // allow site to change the media map before applying it
409
- if (setup.resolveMedia) mediaMap = setup.resolveMedia(mediaMap, locals) || mediaMap;
410
-
411
- if (!!mediaMap.packs && !!mediaMap.packs.runtime) {
412
- mediaMap.packs.runtime = injectTags(mediaMap.packs.runtime, locals.site, SCRIPT_TAG);
413
- }
414
- if (!!mediaMap.packs && !!mediaMap.packs.global) {
415
- mediaMap.packs.global = injectTags(mediaMap.packs.global, locals.site, ASYNC_SCRIPT_TAG);
416
- }
417
-
418
- if (!!mediaMap.packs && !!mediaMap.packs.components) {
419
- mediaMap.packs.components = injectTags(mediaMap.packs.components, locals.site, ASYNC_DEFER_SCRIPT_TAG);
420
- }
421
-
422
- if (!!mediaMap.packs && !!mediaMap.packs.init) {
423
- mediaMap.packs.init = injectTags(mediaMap.packs.init, locals.site, ASYNC_DEFER_SCRIPT_TAG);
424
- }
425
-
426
- if (!locals.edit) {
427
- mediaMap.styles = combineFileContents(mediaMap.styles, 'public/css', '/css/', STYLE_TAG);
428
- mediaMap.scripts = combineFileContents(mediaMap.scripts, 'public/js', '/js/', SCRIPT_TAG);
429
- } else {
430
- mediaMap.styles = module.exports.editStylesTags ? injectTags(mediaMap.styles, locals.site, STYLE_TAG) : combineFileContents(mediaMap.styles, 'public/css', '/css/', STYLE_TAG);
431
- mediaMap.scripts = module.exports.editScriptsTags ? injectTags(mediaMap.scripts, locals.site, SCRIPT_TAG) : combineFileContents(mediaMap.scripts, 'public/js', '/js/', SCRIPT_TAG);
432
- }
433
-
434
- return bluebird.props(mediaMap)
435
- .then(combinedFiles => {
436
- html = combinedFiles.styles ? appendMediaToTop(combinedFiles.styles, html) : html; // If there are styles, append them
437
- html = combinedFiles.packs.runtime ? appendMediaToBottom(combinedFiles.packs.runtime, html) : html; // If there are packs, append them
438
- html = combinedFiles.packs.global ? appendMediaToBottom(combinedFiles.packs.global, html) : html; // If there are packs, append them
439
- html = combinedFiles.packs.components ? appendMediaToBottom(combinedFiles.packs.components, html) : html; // If there are packs, append them
440
- html = combinedFiles.packs.init ? appendMediaToBottom(combinedFiles.packs.init, html) : html; // If there are packs, append them
441
- html = combinedFiles.scripts ? appendMediaToBottom(combinedFiles.scripts, html) : html; // If there are scripts, append them
442
- return html; // Return the compiled HTML
443
- });
444
- };
445
- }
446
-
447
- module.exports.injectScriptsAndStyles = injectScriptsAndStyles;
448
- module.exports.getMediaMap = getMediaMap;
449
- module.exports.cacheBuster = '';
450
- module.exports.configure = configure;
451
- module.exports.editStylesTags = false;
452
- module.exports.editScriptsTags = false;
453
-
454
- // For testing
455
- module.exports.getManifestScripts = getManifestScripts;
456
- module.exports.getScriptFiles = getScriptFiles;
457
- module.exports.getStyleFiles = getStyleFiles;