I am trying to set up a simple index file for all of my models. Ultimately, my goal would be to do something like this...
// models/A.model.js
...
const A = model(...);
const otherA = ...;
export { A, otherA };
// models/B.model.js
...
const B = model(...);
const otherB = ...
export { B, otherB };
// models/index.js
export * from './A.model.js';
export * from './B.model.js';
// server/index.js
import * as models from './models'
models.A
models.otherA
etc.
Currently it appears as if the models/index.js file is not exporting anything. I may be doing this completely wrong. I am using Babel and have used this as a reference