Registry / devops / cogs-transformer-esbuild

cogs-transformer-esbuild

JSON →
library1.0.10jsnpmunverified

An esbuild transformer for the Cogs build system. This package integrates esbuild bundling/minification into Cogs pipelines. It is a thin wrapper around esbuild's transform API, optimized for speed and simplicity. The current version is 1.0.10 with no recent updates (likely stable). Unlike other Cogs transformers (ts, babel), this one leverages esbuild's native speed and TypeScript/JSX support. It is designed for projects already using Cogs.

npm install cogs-transformer-esbuild
INSTALL
IMPORT
SIG · COGS-TRANSFORMER-E
C
cogs-transformer-esbuild
devopsjavascriptv1.0.10
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.

cogs-transformer-esbuild
import cogsTransformerEsbuild from 'cogs-transformer-esbuild'
import { cogsTransformerEsbuild } from 'cogs-transformer-esbuild'
Default import only; no named exports.
cogs-transformer-esbuild (CommonJS)
const cogsTransformerEsbuild = require('cogs-transformer-esbuild')
const { cogsTransformerEsbuild } = require('cogs-transformer-esbuild')
Package supports both ESM and CJS.
TypeScript types
import type { Options } from 'cogs-transformer-esbuild'
import { Options } from 'cogs-transformer-esbuild'
Type imports for configuration options; use `import type` to avoid runtime inclusion.

Shows how to configure the esbuild transformer in a Cogs file with common options.

// cogsfile.js import cogsTransformerEsbuild from 'cogs-transformer-esbuild'; export default { // other Cogs config transformers: [ cogsTransformerEsbuild({ target: 'es2020', minify: true, jsxFactory: 'h', jsxFragment: 'Fragment', }), ], };
Debug
Known issues
gotchaTransformer options must be an object literal; do not pass a function.
fix
Pass a plain object as argument to the transformer factory.
affects: >=1.0.0
gotchaCogs version compatibility: this transformer requires Cogs >=3.x due to ES module support.
fix
Ensure Cogs is updated to version 3 or higher.
affects: >=1.0.0
gotchaThe transformer does not support esbuild's bundle option directly; bundle only works via Cogs plugin cascade.
fix
Use Cogs entry points and plugins to achieve bundling.
affects: >=1.0.0
gotchaJSX runtime automatic mode is not supported; use classic or explicit pragma.
fix
Set jsx: 'preserve' or use jsxFactory/jsxFragment options.
affects: >=1.0.0
deprecatedThe `platform` option in esbuild options is deprecated for this transformer; use Cogs target config.
fix
Remove platform option; configure target platform via Cogs settings.
affects: <2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'cogs-transformer-esbuild'
Package not installed or not in node_modules.
fix
Run `npm install cogs-transformer-esbuild --save-dev`
TypeError: transformer is not a function
Using named import instead of default import.
fix
Use `import cogsTransformerEsbuild from 'cogs-transformer-esbuild'` (default import).
Error: Unknown option: jsxImportSource
The transformer does not support esbuild's jsxImportSource option.
fix
Remove jsxImportSource; use jsxFactory and jsxFragment instead.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies
cogsrequiredCogs is required as the build system; this transformer extends Cogs.
esbuildrequiredesbuild is the core bundler/transformer used internally.
Agent activity
8 hits · last 30 days
node
6
Resources
cogs-transformer-esbuild — npm install cogs-transformer-esbuild · libregistry