{"id":42158,"library":"typack","title":"typack","description":"A native TypeScript declaration (.d.ts) bundler built on Oxc, providing fast bundling of TypeScript declaration files. Current stable version is 0.3.0, released periodically on npm. It differentiates from other d.ts bundlers (like @microsoft/api-extractor or dts-bundle-generator) by leveraging Oxc's performance for native-speed parsing and bundling. It supports external module exclusion, sourcemaps, and CJS default export emission. Requires Node.js >= 20.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/Dunqing/typack","tags":["javascript","bundler","declaration","dts","oxc","typescript"],"install":[{"cmd":"npm install typack","lang":"bash","label":"npm"},{"cmd":"yarn add typack","lang":"bash","label":"yarn"},{"cmd":"pnpm add typack","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"typack is ESM-only; use named import. CommonJS require() will not work.","wrong":"const { bundle } = require('typack')","symbol":"bundle","correct":"import { bundle } from 'typack'"},{"note":"BundleDtsResult is a type; import it with `import type` or use `import { type BundleDtsResult }`.","wrong":"import { BundleDtsResult } from 'typack'","symbol":"BundleDtsResult","correct":"import type { BundleDtsResult } from 'typack'"},{"note":"BundleOptions is a type; import it with `import type`.","wrong":"import { BundleOptions } from 'typack'","symbol":"BundleOptions","correct":"import type { BundleOptions } from 'typack'"}],"quickstart":{"code":"import { bundle } from 'typack';\n\nconst result = bundle({\n  input: ['src/index.d.ts'],\n  external: ['react'],\n  cwd: process.cwd(),\n  sourcemap: true,\n  cjsDefault: false,\n});\n\nconsole.log(result.code);\nif (result.map) {\n  console.log('Source map generated');\n}\nresult.warnings.forEach(w => console.warn(w.message));","lang":"typescript","description":"Bundles a TypeScript declaration file, externalizing 'react', with sourcemap generation."},"warnings":[{"fix":"Upgrade Node.js to version 20 or higher.","message":"Node.js >= 20 is required. Lower versions are not supported.","severity":"breaking","affected_versions":"<0.0.0"},{"fix":"Use import syntax or set your project to ESM mode.","message":"The package is ESM-only. CommonJS require() will throw an error.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Always wrap the entry file in an array: input: ['src/index.d.ts'].","message":"The 'input' option accepts an array of strings, but passing a single string (e.g., 'src/index.d.ts') is a common mistake.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Avoid relying on CJS-specific output; prefer ESM default exports.","message":"The 'cjsDefault' option may be deprecated in future versions as ESM becomes standard.","severity":"deprecated","affected_versions":">=0.3.0"}],"env_vars":null,"search_vec":"'0.3.0':22 '20':65 'built':8 'bundl':13,38,51 'bundler':7,32,67 'cjs':59 'current':18 'd.ts':6,31 'declar':5,16,68 'default':60 'differenti':28 'dts':37,69 'dts-bundle-gener':36 'emiss':62 'exclus':56 'export':61 'extern':54 'fast':12 'file':17 'generat':39 'javascript':66 'leverag':41 'like':33 'microsoft/api-extractor':34 'modul':55 'nativ':3,47 'native-spe':46 'node.js':64 'npm':26 'oxc':10,42,70 'pars':49 'perform':44 'period':24 'provid':11 'releas':23 'requir':63 'sourcemap':57 'speed':48 'stabl':19 'support':53 'typack':1 'typescript':4,15,71 'version':20","created_at":"2026-06-04T18:55:54.060048+00:00","updated_at":"2026-06-04T18:55:54.060048+00:00","problems":[{"fix":"Change to import { bundle } from 'typack'; or add \"type\": \"module\" in package.json.","cause":"Using CommonJS require() to import an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/typack/dist/index.js not supported."},{"fix":"Use import { bundle } from 'typack';","cause":"Incorrect import (e.g., using default import instead of named import).","error":"TypeError: bundle is not a function"},{"fix":"Run npm install typack and ensure Node.js >= 20.","cause":"Package not installed or Node.js version below 20.","error":"Error: Cannot find module 'typack'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Dunqing/typack","github":"https://github.com/Dunqing/typack","docs":null,"changelog":null,"pypi":null,"npm":"typack","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}