I have an example file structure:
-data
-cars
-users
Inside each of these folders (cars and users) I have a config.js file in which I export an object with data, e.g .:
export default {
title: 'aaa',
color: 'bbb',
}
Question: How can I get to each of these files (config.js) without importing them. I have a project written in Vue. I mean, for example, to download data by raw-loader from the webpack, but in it I have to declare the path and I mean that the path should look like this: ../data/(every folder inside 'data' folder)/config.js
const versioninfo = require(`raw-loader!${../data/(every folder inside 'data' folder)/config.js}`).default
console.log(versioninfo)
I found another solution, I used
require.context
: