-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
How to use it in using ES6 modules #89
Comments
To make the above code work in a environment that doesn't support ES6 imports, you would need to use the CommonJS require syntax instead of the ES6 import syntax. Here's how the code would look:
|
if you use CommonJS then please update package.json also. ( remove "type": "module") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import dotenv from "dotenv";
dotenv.config({ silent: process.env.NODE_ENV === 'production' });
const session = require('express-session');
const passport = require("passport");
import express from 'express';
import bodyParser from 'body-parser';
import mongoose from 'mongoose';
import cors from 'cors'; //doubt
import postRoutes from './routes/posts.js';
import userRouter from "./routes/user.js";
How to make the above code work in using 3rd party libraries like one without ES6 .
The text was updated successfully, but these errors were encountered: