Reputation: 181
import routes from "./src/router/routes";
module.exports = {
// routes
}
can not use es6 module here, it gives an error:
import routes from "./src/router/routes";
^^^^^^
SyntaxError: Unexpected identifier
also require does not work, as routes are ES6 modules (have import statements)
const routes = require("./src/router/routes");
Upvotes: 3
Views: 1407
Reputation: 1921
You must enable the ES6 Modules in NodeJs.
Check this links for enable:
ATTENTION: This resource is experimental
Upvotes: 1