I am using convictjs to manage the configuration files for my nodejs application. The file that has the configuration schema is called "config.js" and it is in the "config" folder.
I am using es6 import and export statements
import convict from "convict";
import dotenv from "dotenv";
import configDev from "./config.dev";
import configProd from "./config.prod";
import configStage from "./config.stage";
.
.
.
export default config.getProperties();
These configuration files contain database credentials and other necessary database information, which I use in the "index.js" for the sequelize models.
Note: Early on in the development process we tried using es6 with sequelize ran into other problems so we opted to using es5 for models, migrations and seeds.
Currently whenever I try to execute migrations, seuqlize throws an error as shown below
ERROR: Error reading "config\config.js". Error: SyntaxError: Unexpected token
import
Babel is setup properly, I can transpile and run the application without any issues except for database migrations. Any help to resolve this issue is much appreciated.