{"id":20754,"library":"webpack-entry-plus","title":"webpack-entry-plus","description":"Generate dynamic webpack bundle output names from wildcarded entry files using an array of entry/output definitions. Version 1.0.19 is the latest release; the package is stable but infrequently updated. It supports both string and function-based output name transformations, and integrates with glob for wildcard matching. Unlike manual entry configuration, it avoids hardcoding bundle names, which is useful for CMS or multi-page architectures. Requires webpack 4+ and works with Node.js. No breaking changes since initial release, but it is not actively maintained.","status":"maintenance","version":"1.0.19","language":"javascript","source_language":"en","source_url":"https://github.com/sanjsanj/webpack-entry-plus","tags":["javascript","webpack","plugin","entry","output","dynamic","bundle"],"install":[{"cmd":"npm install webpack-entry-plus","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-entry-plus","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-entry-plus","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package does not ship ESM; only CommonJS require works. Use default import via require.","wrong":"import entryPlus from 'webpack-entry-plus';","symbol":"entryPlus","correct":"const entryPlus = require('webpack-entry-plus');"},{"note":"Not a named export; the package exports a single function.","wrong":"const { entryPlus } = require('webpack-entry-plus');","symbol":"entryPlus","correct":"const entryPlus = require('webpack-entry-plus');"},{"note":"No .default property; use direct require.","wrong":"const eP = require('webpack-entry-plus').default;","symbol":"entryPlus","correct":"const entryPlus = require('webpack-entry-plus');"}],"quickstart":{"code":"// webpack.config.js\nconst path = require('path');\nconst entryPlus = require('webpack-entry-plus');\nconst glob = require('glob');\n\nconst entryItems = [\n  {\n    entryFiles: ['file1.js'],\n    outputName: 'bundle1'\n  },\n  {\n    entryFiles: glob.sync('./pages/*.js'),\n    outputName(item) {\n      return item.replace('.js', '').replace(/^.*[\\\\/]/, '');\n    }\n  }\n];\n\nmodule.exports = {\n  entry: entryPlus(entryItems),\n  output: {\n    filename: '[name].js',\n    path: path.resolve(__dirname, 'dist')\n  }\n};","lang":"javascript","description":"Shows how to configure webpack with dynamic entry names using glob patterns and a function for output name transformation."},"warnings":[{"fix":"Use const entryPlus = require('webpack-entry-plus');","message":"Package exposes only one function. Ensure you are requiring correctly as default.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Resolve paths relative to webpack's context or use absolute paths with glob.sync(..., { cwd: ... })","message":"The entryFiles array must contain file paths relative to your webpack context or absolute paths. Glob patterns from glob.sync() return relative paths which may need adjustment.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Return a string that does not contain path separators (use replace to strip directories).","message":"When using a function for outputName, it must return a string that will be used as the [name] in output. The function receives the full file path; ensure replacements produce valid filenames.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a function for outputName when you need separate bundles per entry file.","message":"If outputName is a string, all entryFiles will be bundled into a single output chunk. This may not be intended if you want separate bundles.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use webpack's native entry configuration or another plugin if you need advanced entry features.","message":"The package does not support webpack 5's new entry descriptor syntax (e.g., { import, dependOn }). Only an array of strings is accepted per entryFiles item.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add a .d.ts file: declare module 'webpack-entry-plus' { const entryPlus: (entries: EntryItem[]) => any; export default entryPlus; }","message":"No type definitions provided. TypeScript users need to create a custom declaration file.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"npm install --save-dev glob","message":"The package uses require('glob') internally if not passed? No, it expects you to pass glob results. You must install glob separately.","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":"Install: npm install --save-dev webpack-entry-plus, then use require('webpack-entry-plus')","cause":"Missing install or incorrect import path.","error":"Cannot find module 'webpack-entry-plus'"},{"fix":"Use const entryPlus = require('webpack-entry-plus');","cause":"Incorrect import: using default import with ES module syntax or destructuring.","error":"TypeError: entryPlus is not a function"},{"fix":"Ensure each item in the array has a outputName that is either a string or a function returning a string.","cause":"Passing an invalid entry object, typically because outputName is not a string or function.","error":"Error: The 'entry' option must be an object, function, or string"},{"fix":"Install glob: npm install --save-dev glob","cause":"Glob is not installed, but it is required only if you use glob.sync in your config.","error":"Module not found: Error: Can't resolve 'glob'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}