simple function to transform glob patterns in webpack entry object
npm install webpack-glob-entry













simple function to transform glob patterns in webpack entry object
``bash`
npm install webpack-glob-entry --save-dev
simply call entry function with glob pattern
`javascript
var entry = require('webpack-glob-entry')
module.exports = {
entry: entry('js/*.entry.js'),
output: {
path: 'public/build',
publicPath: 'build',
filename: '[name].bundle.js',
chunkFilename: '[id].chunk.js'
}
}
`
you can also pass multiple glob patterns like this
`javascript`
entry: entry('foo/.js', 'bar/.js', 'baz/*.js'),
you can also pass entryName function as first argument like this
`javascript
var path = require('path')
module.exports = {
entry: entry(filePath => path.basename(filePath), 'bar/.js', 'baz/.js')
}
`
you can also use entry.basePath function as first argument like this
`javascript
module.exports = {
entry: entry(entry.basePath(), 'bar/.js', 'baz/.js')
}
module.exports = {
entry: entry(entry.basePath('src'), 'src/bar/.js', 'src/baz/.js')
}
module.exports = {
entry: entry(entry.basePath('src', '.js'), 'src/bar/.some.js', 'src/baz/.js')
}
``