Primitive Script Bundler
raw JSON → 1.0.16 verified Sat Apr 25 auth: no javascript
A minimal JavaScript bundler inspired by Webpack, designed for simple projects that need to concatenate multiple script files into a single bundle. Version 1.0.16 is the latest stable release, with infrequent updates. Unlike Webpack or Rollup, it offers no module resolution, tree-shaking, or code splitting; it simply concatenates files in order. Suitable for small hobby projects but not for production use. Not actively maintained.
Common errors
error Error: Cannot find module 'primitive-script-bundler' ↓
cause Package not installed or missing from node_modules.
fix
Run 'npm install primitive-script-bundler' in your project root.
error TypeError: bundle is not a function ↓
cause Incorrect import; likely used default import with ESM syntax.
fix
Use const bundle = require('primitive-script-bundler'); then bundle();
error Error: Config file not found: config.json ↓
cause The config.json file is missing from the root directory where the script is run.
fix
Create a config.json file in the same directory with the required files and output fields.
Warnings
gotcha The package does not resolve import/require statements. Files are concatenated exactly in the order specified in config.json. ↓
fix Manually order your files so that dependencies appear before dependents.
gotcha The output bundle is not minified. You must use an external minifier for production. ↓
fix Pipe bundle through tools like terser or uglify-js.
gotcha No support for TypeScript, JSX, or any transpilation. Only plain JavaScript. ↓
fix Pre-process files with Babel or TypeScript compiler before bundling.
gotcha The package is not actively maintained; last update was over two years ago. ↓
fix Consider alternatives like Webpack, Rollup, or esbuild for active support.
Install
npm install primitive-script-bundler yarn add primitive-script-bundler pnpm add primitive-script-bundler Imports
- bundle wrong
import bundle from 'primitive-script-bundler';correctconst bundle = require('primitive-script-bundler'); - config
// No explicit import, uses config.json in project root - runBuild wrong
bundle.bundle();correctbundle();
Quickstart
// config.json
{
"files": ["src/a.js", "src/b.js"],
"output": "dist/bundle.js"
}
// index.js
const bundle = require('primitive-script-bundler');
bundle();