{"id":20774,"library":"webpack-glob","title":"webpack-glob","description":"A tool that combines webpack with glob patterns, allowing you to specify multiple webpack configuration files using minimatch/wildcard patterns. Version 2.0.2 is the latest stable release, though development has been sparse since 2016. It provides both CLI and programmatic (Node.js) APIs for compiling glob-matched webpack configs. Differentiates itself by enabling multi-config webpack setups without manual file listing.","status":"maintenance","version":"2.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/mdreizin/webpack-glob","tags":["javascript","webpack","glob","gaze","minimatch"],"install":[{"cmd":"npm install webpack-glob","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-glob","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-glob","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for compilation","package":"webpack","optional":false},{"reason":"Used internally for glob pattern matching","package":"minimatch","optional":false}],"imports":[{"note":"Package uses CommonJS; no ESM export provided.","wrong":"import WebpackGlob from 'webpack-glob';","symbol":"WebpackGlob","correct":"var WebpackGlob = require('webpack-glob');"},{"note":"TypeScript with esModuleInterop: use import = require.","wrong":"import * as WebpackGlob from 'webpack-glob';","symbol":"WebpackGlob","correct":"import WebpackGlob = require('webpack-glob');"},{"note":"The only export is the constructor itself, not a named member.","wrong":"const { WebpackGlob } = require('webpack-glob');","symbol":"default export","correct":"const WebpackGlob = require('webpack-glob');"}],"quickstart":{"code":"var WebpackGlob = require('webpack-glob');\nvar webpackOptions = {\n  output: { path: './dist' },\n  stats: { colors: true }\n};\nvar compilerOptions = {\n  progress: true,\n  json: false,\n  memoryFs: false\n};\nvar webpack = new WebpackGlob(compilerOptions, webpackOptions);\nwebpack.run('./src/**/webpack.config.js').then(function() {\n  console.log('done');\n}).catch(function(err) {\n  console.error(err);\n});","lang":"javascript","description":"Creates a WebpackGlob instance with default options and compiles all webpack config files matching the glob pattern."},"warnings":[{"fix":"Switch to require() or use bundler transform for CommonJS.","message":"The package only supports CommonJS; ES module imports will fail. Use require() or configure bundler for CommonJS interop.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use watch mode via compilerOptions.watch instead.","message":"The closestWatch option was removed in v2.0.0 and no longer works.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Verify glob pattern. Use --config with quotes in CLI or escape properly.","message":"If no matching config files are found, webpack-glob may hang or not error. Ensure glob pattern is correct.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install webpack --save-dev","cause":"webpack is not installed as a peer dependency.","error":"Error: Cannot find module 'webpack'"},{"fix":"Use const WebpackGlob = require('webpack-glob');","cause":"Using ES6 import incorrectly, or destructuring the require result.","error":"TypeError: WebpackGlob is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}