Registry / devops / pg-template-esbuild

pg-template-esbuild

JSON →
library1.9.0jsnpmunverified

pg-template-esbuild is a build tool and project generator based on esbuild, version 1.9.0. It provides a starter template and builder for JavaScript/TypeScript projects, automating bundling, minification, and transpilation. Designed for Node.js >=14, it offers fast builds with zero configuration, leveraging esbuild's speed. It differentiates itself from other generators (e.g., create-react-app, Vite) by focusing on minimal setup and pure esbuild integration, suitable for libraries or simple applications. Development appears active with regular updates, but the package has low usage and may lack community support. Release cadence is monthly.

npm install pg-template-esbuild
INSTALL
IMPORT
SIG · PG-TEMPLATE-ESBUIL
P
pg-template-esbuild
devopsjavascriptv1.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import { build } from 'pg-template-esbuild'
const pgTemplate = require('pg-template-esbuild')
The package exports a named `build` function. CommonJS require() will not work due to ESM-only; use dynamic import() if needed.
defineConfig
import { defineConfig } from 'pg-template-esbuild'
import defineConfig from 'pg-template-esbuild'
defineConfig is a named export, not default. Use named import syntax.

This code demonstrates a basic build configuration: compiles a TypeScript entry point to bundled ESM output in the dist folder, with minification and source maps.

import { build } from 'pg-template-esbuild'; build({ entryPoints: ['./src/index.ts'], outdir: './dist', format: 'esm', target: 'node14', bundle: true, minify: true, sourcemap: true, });
Debug
Known issues
breakingVersion 1.9.0 drops CommonJS support; only ESM is accepted.
fix
Convert require() to dynamic import(). Ensure package.json type: 'module' or use .mjs extension.
affects: >=1.9.0
deprecatedThe `sourcemap` option is deprecated in favor of `sourceMappingURL` in esbuild v0.18+. May be removed in future.
fix
Use `sourcemap: true` but plan migration to esbuild's new options.
affects: >=1.9.0
gotchaThe package expects `esbuild` as a peer dependency, but does not install it automatically.
fix
Run `npm install esbuild --save-dev` before using pg-template-esbuild.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'esbuild'
Missing esbuild as a peer dependency.
fix
Install esbuild: `npm install esbuild --save-dev`
TypeError: pg_template_esbuild_1.build is not a function
Using require() on an ESM-only package.
fix
Use dynamic import: `const { build } = await import('pg-template-esbuild')`
Upgrade
Version history
1.9.0latest on npm
Audit
Dependencies
esbuildrequiredCore bundler for the build pipeline
Agent activity
8 hits · last 30 days
node
8
Resources
pg-template-esbuild — npm install pg-template-esbuild · libregistry