I'm working on NodeJs project
This is not working
import Env from "./utils/Env";
Error [ERR_MODULE_NOT_FOUND]: Cannot find module ...\Env
This is my Env.js code
export default class Env {
static isLocal() {
return !(process.env.NODE_ENV === 'production');
}
static isProd() {
if (process.env.NODE_ENV === 'production' && process.env.GCLOUD_PROJECT === 'extendedbuilder') {
return true;
}
return false;
}
}
But if I add .js, then works
import Env from "./utils/Env.js";
Is there any way for ignoring the ".js" when I'm importing the module?
Thank you