webpack-encore
webpack-encore copied to clipboard
Webpack virtual module supports
Hi,
the stimulus-bridge plugin make use of webpack-virutal-module plugin to dynamically compile new modules according to the defined controllers.json file. Would it make sense to extend and prepare something to dynamically load entries from a json file?
Something like this
# webpack.config.js
Encore
.addDynamicEntries('assets/pages.json')
# pages.json
{
"entries": {
"security_login": "./assets/pages/security/login.js",
"security_register": "./assets/pages/security/register.js"
}
}
We have a lot of page-specific entries and always adding it to the webpack configuration (with the need of restart it every time) is becoming a mess.
What do you think?
That's an interesting idea! I am open to it if someone wants to submit a pull request :).