I have an async function that returns a set of webpack entries, I'd like to use async / await to get the entry property from the function but because of webpack.config.js module.export of a plain object I can't execute any top-level await and return a plain object.
Here's what I mean:
const myFunc = require('./something');
const entry = await myFunc(__dirname);
module.exports = {
entry,
"mode": "development",
"output": {
"path": __dirname+'/static',
"filename": "[name].[chunkhash:8].js"
}
}
Of course I understand that top-level wait is not possible, however, I need module.export to export a promise instead of this plain object. Is this possible within webpack?