Created
January 29, 2020 19:06
-
-
Save fimion/ae3931fde960c299686c885f8c1a4c4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ListOfXML = []; | |
// https://webpack.js.org/guides/dependency-management/#require-context | |
const requireComponent = require.context( | |
// Look for files in a directory | |
'/path/to/xml/files', | |
// Do not look in subdirectories | |
false, | |
// Only include ".xml" files | |
/.*\.xml$/ | |
) | |
// For each matching file name... | |
requireComponent.keys().forEach((fileName) => { | |
ListOfXML.push(filename); | |
}) | |
export default ListOfXML |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment