{"id":20758,"library":"webpack-entries","title":"webpack-entries","description":"Utility to generate webpack entry points from glob patterns. Current stable version is 1.0.0, released with low frequency. Converts glob matches into arrays or objects (keyed by file name or relative path) suitable for webpack's entry configuration. No dependencies. Lightweight alternative to manual entry definition.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://frontainer@github.com/frontainer/webpack-entries","tags":["javascript","webpack","glob","entry"],"install":[{"cmd":"npm install webpack-entries","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-entries","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-entries","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package uses CommonJS; no ESM or TypeScript typings provided.","wrong":"import entries from 'webpack-entries';","symbol":"default","correct":"var entries = require('webpack-entries');"},{"note":"Second boolean parameter controls output format: false (default) returns array, true returns object.","wrong":"entries('./src/js/*.js'); // omitting second argument returns array, not object","symbol":"entries function","correct":"entries('./src/js/*.js', true);"},{"note":"When multiple is true and pattern includes **, keys include relative paths (e.g., 'js/a').","wrong":"entries('./src/**/*.js', false); // returns flat array, losing directory structure","symbol":"object with nested keys","correct":"entries('./src/**/*.js', true);"}],"quickstart":{"code":"var entries = require('webpack-entries');\nvar path = require('path');\n\nmodule.exports = {\n  entry: entries('./src/js/*.js', true),\n  output: {\n    filename: '[name].bundle.js',\n    path: path.resolve(__dirname, 'dist')\n  }\n};","lang":"javascript","description":"Shows how to require webpack-entries and use it in a webpack config to generate entry points from a glob pattern, producing an object with file name keys."},"warnings":[{"fix":"Ensure glob pattern yields unique base file names or use nested patterns with /**/ to include path in keys.","message":"File names without extension are used as keys (e.g., 'a' from 'a.js'); duplicates overwrite previous entries.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Wrap call in try-catch or ensure pattern matches at least one file.","message":"The function throws synchronously if glob pattern matches no files; no graceful error handling.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use dynamic import or CommonJS require in an ES module context: const entries = await import('webpack-entries').then(m => m.default);","message":"Only supports CommonJS require; no ES module or TypeScript support.","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":"Run: npm install webpack-entries --save-dev","cause":"Package not installed or installed as --save-dev not --save","error":"Cannot find module 'webpack-entries'"},{"fix":"Use const entries = require('webpack-entries'); or const { default: entries } = await import('webpack-entries');","cause":"Incorrect import style (e.g., import entries from 'webpack-entries' in ESM context)","error":"entries is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}