|
@@ -9,17 +9,17 @@ const defaultAssetRegex = /[{]{2}([^}]+)[}]{2}/g;
|
|
|
* Replaces asset names with the first of the asset files from a webpack compilation.
|
|
|
*
|
|
|
* @param {string} targetSource - a string in which to replace the assets
|
|
|
- * @param {Object} assetFiles - a map of available asset names and their containing files
|
|
|
+ * @param {Object} assetFileNames - a map of available asset names and their containing files
|
|
|
* @return {string}
|
|
|
*/
|
|
|
-function replaceAssets (targetSource, assetFiles) {
|
|
|
+function replaceAssets (targetSource, assetFileNames) {
|
|
|
return targetSource.replace(defaultAssetRegex, function replaceAsset (match, assetName) {
|
|
|
- if (!(assetFiles[assetName] && assetFiles[assetName].length)) {
|
|
|
+ if (!(assetFileNames[assetName] && assetFileNames[assetName].length)) {
|
|
|
console.warn(`no asset for '${assetName}' was found`);
|
|
|
return match;
|
|
|
}
|
|
|
|
|
|
- return assetFiles[assetName][0];
|
|
|
+ return assetFileNames[assetName];
|
|
|
});
|
|
|
}
|
|
|
|