├── project
│ └── operation
│ ├── index.minus.js
│ └── index.plus.js
│ └── index.js
export default (a, b) => (a - b);
export default (a, b) => (a + b);
import operation from './operation';
const result = operation(2, 3);
console.log(result);
My requirement is to set an environment variable like OPERATION_NAME and based on its value (minus | plus) we have to import that particular index.${OPERATION_NAME}.js into the project/index.js file.
How to implement this functionality using babel or any other mechanisms?