Skip to content

Commit ae101c6

Browse files
authored
fix(build-resources): allow scoped packages in fixRelativeFromPath
1 parent 5f6f3b4 commit ae101c6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/build-resources.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,10 @@ async function autoresolveTemplates(resources, packagePath, srcPath) {
352352
}
353353

354354
function fixRelativeFromPath(fromPath, realSrcPath, realParentPath, externalModule) {
355-
let modulePathIndex = moduleNames.indexOf(fromPath.split('/')[0]);
356-
if (modulePathIndex !== -1) {
355+
let fromPathSplit = fromPath.split('/');
356+
if (moduleNames.indexOf(fromPathSplit[0]) !== -1 || moduleNames.indexOf(path.join(fromPathSplit[0], fromPathSplit[1])) !== -1) {
357357
// already a module reference, non-relative, leave as-is:
358358
return fromPath;
359-
// let modulePath = modulePaths[modulePathIndex];
360359
} else {
361360
// if starts with './' then relative to the template, else relative to '/src'
362361
if (fromPath.indexOf('.') == 0) {

0 commit comments

Comments
 (0)