webpack-glob-entries-plugin

1.0.0 • Public • Published

webpack-glob-entries-plugin

Provides a way to glob for entry files in Webpack watch and non-watch modes.

NPM Version Download Status Node Version Dependencies

API

new WebpackGlobEntriesPlugin(globsstring|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]
};

Thanks

Milanzor/webpack-watched-glob-entries-plugin

Package Sidebar

Install

npm i webpack-glob-entries-plugin

Weekly Downloads

1,380

Version

1.0.0

License

MIT

Unpacked Size

10.2 kB

Total Files

6

Last publish

Collaborators

  • nuintun