Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impossible import in a "module"-type module #38

Open
linqFR opened this issue Apr 2, 2021 · 0 comments
Open

impossible import in a "module"-type module #38

linqFR opened this issue Apr 2, 2021 · 0 comments

Comments

@linqFR
Copy link

linqFR commented Apr 2, 2021

When adding oas3-tools into an application of "type":"module" (package.json), import xxxx from '/xxxx.js' syntax (instead of require) is not enabled in "controllers" files.

controller = require(path.resolve(path.join(dir, controllerName)));

So to be able to use regular "import" syntax, one should use file extensions .cjs or .mjs which is not accepted by hereunder line:

const jsFileRegex = /\.(coffee|js|ts)$/;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant