webpack-glob-entries-plugin
v1.0.0
Published
Provides a way to glob for entry files in Webpack watch and non-watch modes.
Downloads
3,690
Maintainers
Readme
webpack-glob-entries-plugin
Provides a way to glob for entry files in Webpack watch and non-watch modes.
API
new WebpackGlobEntriesPlugin(globs: string|string[], options?: { glob: Object, resolveEntryName: Function });
- globs: The glob string or array of glob strings.
- options: The configure options.
- options.glob: The node-glob configure options.
- options.resolveEntryName: The entry name resolve function.
Usage
const WebpackGlobEntriesPlugin = require('webpack-glob-entries-plugin');
const watcher = new WebpackGlobEntriesPlugin('src/js/pages/**/*.js');
module.exports = {
mode: 'development',
entry: watcher.entries(),
output: {
publicPath: '/dist/',
path: path.resolve('dist'),
filename: 'js/pages/[name].js',
chunkFilename: 'js/chunks/[chunkhash].js'
},
plugins: [watcher]
};