context: path.join(__dirname, 'resources/assets/bundle/js'),
entry: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
'./*.js'
]
Is above code even valid? instead of specifying every single file like
context: path.join(__dirname, 'resources/assets/bundle/entries'),
entry: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
'./abc.js',
'./def.js'
]
how can I include entire folder?
You can easily do this by your own, as the webpack.config.js is just a node.js module and allows to execute any code. Wildcards in entry points
Webpack uses entry point to resolve the reference to generate the bundle. you can define multiple entry point based on the number of bundle needed. you should not be adding entire folder as entry point, it means you want bundle of each file inside the folder, which webpack does not recommend.
Why do you use the entire folder?
if you want entire folder , you can use
glob
npm moduleAs explained : https://github.com/webpack/webpack/issues/370
but webpack is not recommended entire folder, the entry value should resolve to a specific file, or a list of specific files.