Skip to content

Commit e30afc2

Browse files
authored
fix(build-resources): ignore <require> with template strings
fixes #56
1 parent fc9cdd6 commit e30afc2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/build-resources.js

+5
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ function fixRelativeFromPath(fromPath, realSrcPath, realParentPath, externalModu
383383
}
384384
}
385385

386+
const templateStringRegex = /\${.+}/;
387+
386388
/**
387389
* Generates key-value dependency pairs of:
388390
* - <require from="paths">
@@ -402,6 +404,7 @@ function resolveTemplateResources(htmlFilePath, srcPath, externalModule) {
402404
const requireTags = $('require');
403405
requireTags.each(index => {
404406
const fromPath = requireTags[index].attribs.from;
407+
if (templateStringRegex.test(fromPath)) return;
405408
const isLazy = requireTags[index].attribs.hasOwnProperty('lazy');
406409
const bundle = requireTags[index].attribs.bundle;
407410
if (fromPath)
@@ -412,6 +415,7 @@ function resolveTemplateResources(htmlFilePath, srcPath, externalModule) {
412415
const viewModelRequests = $('[view-model]');
413416
viewModelRequests.each(index => {
414417
const fromPath = viewModelRequests[index].attribs['view-model'];
418+
if (templateStringRegex.test(fromPath)) return;
415419
const isLazy = viewModelRequests[index].attribs.hasOwnProperty('lazy');
416420
const bundle = viewModelRequests[index].attribs.bundle;
417421
if (fromPath)
@@ -422,6 +426,7 @@ function resolveTemplateResources(htmlFilePath, srcPath, externalModule) {
422426
const viewRequests = $('[view]');
423427
viewRequests.each(index => {
424428
const fromPath = viewRequests[index].attribs.view;
429+
if (templateStringRegex.test(fromPath)) return;
425430
const isLazy = viewRequests[index].attribs.hasOwnProperty('lazy');
426431
const bundle = viewRequests[index].attribs.bundle;
427432
if (fromPath)

0 commit comments

Comments
 (0)