This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Description
Trying to import a .js file as this
import:
- module: config/dynamic.js
inputs:
var: test
will throw the following error.
Error: Cannot import config/dynamic.js
Cause: Cannot find module 'config/dynamic.js'
The problem seems to be with the import path, the issue seems to be in this check that will not fail
|
if (tryOrUndefined(() => statSync(pathToImport))) { |
but the subsequent require will.
|
const importExports = require(importPath) |
Removing the check fixes the problem.
A solution would be to bypass the check if the file has a .js ext or completely removing the check but don't know if that impacts something else, didn't dig too much into the code.