Is there any way to automatically import recently added files into some file (let's assume index.js) whenever we create a new file?
For example:
/components
---File1.js
---File2.js
---index.js
When I create File3.js
, I want it to be automatically added into index.js so within index.js it can also export automatically
// index.js
const functionToGrapAllFilesWithinFolder = () => {
// is there any way possible?
// I know that using fs is not possible since it is only work at Node env, not on the browser
}
// const files = functionToGrabAllFilesWithinFolder()
export default files;