vendor-generator
raw JSON → 0.4.8 verified Sat Apr 25 auth: no javascript maintenance
A JavaScript bundler tool that compiles and bundles JavaScript files into a single file for browser use. Version 0.4.8 is the latest stable release, with an unknown release cadence. It differs from bundlers like Webpack or Rollup by providing a simple CLI-only interface with minimal configuration, targeting users who need a quick way to vendor libraries into a single script without complex setup. It supports CommonJS modules and outputs a bundle compatible with script tags. However, the project appears to be in early stages with limited documentation and no recent updates.
Common errors
error TypeError: vendorGenerator is not a function ↓
cause The package was imported using ES modules (import) instead of CommonJS require.
fix
Use const vendorGenerator = require('vendor-generator');
error Cannot find module 'vendor-generator' ↓
cause The package is not installed in node_modules.
fix
Run npm install vendor-generator --save-dev
Warnings
breaking Node.js version requirement is >=8, which includes unsupported versions (8 and 10) that have reached end-of-life. May break on Node 16+. ↓
fix Use a newer version of Node.js >=12, but test for compatibility as dependencies may be outdated.
deprecated No new releases since 2019; package likely unmaintained. ↓
fix Consider migrating to actively maintained bundlers like Webpack, Rollup, or esbuild.
gotcha The package does not support ES modules (import/export) natively; only CommonJS require is supported. ↓
fix Ensure all input files use CommonJS syntax, or transpile ES modules to CommonJS before bundling.
Install
npm install vendor-generator yarn add vendor-generator pnpm add vendor-generator Imports
- vendorGenerator wrong
import vendorGenerator from 'vendor-generator'correctconst vendorGenerator = require('vendor-generator')
Quickstart
const vendorGenerator = require('vendor-generator');
const path = require('path');
vendorGenerator({
entry: path.resolve(__dirname, 'src/index.js'),
output: path.resolve(__dirname, 'dist/bundle.js'),
minify: false
}).then(() => {
console.log('Bundle created successfully');
}).catch(err => {
console.error('Error:', err);
});