cli: allow js files to be processed by nodeTransform
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Allow js files to be processed by the nodeTransform loader
|
||||
@@ -127,10 +127,10 @@ async function withDetectedModuleType(resolved) {
|
||||
};
|
||||
}
|
||||
|
||||
// TODO(Rugvip): Afaik this should never happen and we can remove this check, but want it here for a little while to verify.
|
||||
if (ext === '.js') {
|
||||
throw new Error('Unexpected .js file without explicit format');
|
||||
}
|
||||
// Under normal circumstances .js files should reliably have a format and so
|
||||
// we should only reach this point for .ts files. However, if additional
|
||||
// custom loaders are being used the format may not be detected for .js files
|
||||
// either. As such we don't restrict the file format at this point.
|
||||
|
||||
// TODO(Rugvip): Does this need caching? kept it simple for now but worth exploring
|
||||
const packageJsonPath = await findPackageJSON(fileURLToPath(resolved.url));
|
||||
|
||||
Reference in New Issue
Block a user