Wch TypeScript Transpiler
raw JSON → 0.1.3 verified Fri May 01 auth: no javascript maintenance
A TypeScript transpiler plugin for wchd (^0.10.0), version 0.1.3. Enables TypeScript compilation within the wch asset pipeline. No active maintenance noted; pinned to wch^0.10.0. Differentiator: lightweight alternative to full TS setup for wch projects.
Common errors
error Error: Cannot find module 'wch-typescript' ↓
cause Package not installed or not in node_modules.
fix
npm install wch-typescript
error TypeError: wchTypescript is not a function ↓
cause Wrong import pattern (e.g., used .default on a non-default export).
fix
Ensure correct require: const wchTypescript = require('wch-typescript').default;
error Error: Plugin must be a function ↓
cause Passing the module directly instead of the default export function.
fix
Use require('wch-typescript').default as the plugin.
error Error: Cannot find module 'wch' ↓
cause Peer dependency wch not installed.
fix
npm install wch@^0.10.0
Warnings
breaking Requires wch version ^0.10.0; incompatible with other versions. ↓
fix Ensure wch@^0.10.0 is installed.
deprecated Package is in maintenance mode with no recent updates; consider migrating to official wch TypeScript support if available. ↓
fix Check wch documentation for built-in TypeScript support.
gotcha CommonJS only; no ES module support. ↓
fix Use require() instead of import.
gotcha Default export is a function; direct require returns the function itself, not an object. ↓
fix Use .default or call the result directly.
Install
npm install wch-typescript yarn add wch-typescript pnpm add wch-typescript Imports
- wchTypescript
const wchTypescript = require('wch-typescript') - default export wrong
const wchTypescript = require('wch-typescript')correctconst wchTypescript = require('wch-typescript').default - TypeScript type
import type { Options } from 'wch-typescript'
Quickstart
const wch = require('wch');
const wchTypescript = require('wch-typescript').default;
// Configure wch pipeline
wch.plugin(wchTypescript({
tsconfig: './tsconfig.json',
target: 'es2015',
sourcemap: false
}));
// Build pipeline
wch.build('src/*.ts', 'dist/js/');