{"id":25138,"library":"crx-compiler","title":"CRX Compiler","description":"CRX Compiler is a CLI tool for building and signing Chrome extensions. It automates TypeScript compilation, packaging into CRX/ZIP formats, and key generation for signing. Current stable version 1.1.3. Designed for developers who need a simple, all-in-one build pipeline for Chrome extensions without manual steps. Differentiators: built-in tsconfig generation, key generation in RSA 2048, and both CRX and ZIP output. Ships TypeScript declarations for API usage.","status":"active","version":"1.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/MagIlyasDOMA/crx-compiler","tags":["javascript","cli","crx","compile","typescript"],"install":[{"cmd":"npm install crx-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add crx-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add crx-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Use npx for project-local execution if installed as devDependency.","wrong":"crx-compiler (without npx if not globally installed)","symbol":"crx-compiler (default command)","correct":"npx crx-compiler"},{"note":"Generates tsconfig.json. Equivalent to crx-tsconfig.","wrong":"crx-tsconfig (deprecated alias, still works)","symbol":"crx-tsc-init","correct":"npx crx-tsc-init"},{"note":"Generates key.pem and public_key.pem. Specify custom paths via arguments.","wrong":"","symbol":"crx-keygen","correct":"npx crx-keygen"},{"note":"Prepares files for build; copies from src to pre_dist.","wrong":"","symbol":"crx-precompile","correct":"npx crx-precompile"}],"quickstart":{"code":"npx crx-tsc-init -i src -o pre_dist && npx crx-precompile -s src -p pre_dist -c && npx crx-keygen key.pem public.pem && npx crx-compiler -s src -p pre_dist -d dist -k key.pem -C","lang":"typescript","description":"Complete build pipeline: init TS config, precompile, generate keys, and build CRX+ZIP with cleanup."},"warnings":[{"fix":"Update Node.js to 14 or later, npm to 6 or later.","message":"crx-compiler requires Node.js 14+ and npm 6+.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"After crx-keygen, read public_key.pem, convert to base64, and add to manifest.json.","message":"Key generation uses RSA 2048; public key must be added to manifest.json as 'key' field (base64 without headers).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace crx-tsconfig with crx-tsc-init.","message":"crx-tsconfig alias is deprecated. Use crx-tsc-init instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use -C for clean all, -c for only CRX.","message":"The --clean flag (uppercase -C) deletes both pre_dist and dist directories; lowercase -c is used for --only-crx. Confusing.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run crx-keygen first or provide path to existing private key.","message":"If key file is missing, crx-compiler fails with an error. Ensure key.pem exists or use --key-file to specify.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run crx-precompile or specify manifest path via --manifest.","cause":"The pre_dist directory does not contain manifest.json, possibly because crx-precompile wasn't run or manifest is in src.","error":"Error: ENOENT: no such file or directory, open 'pre_dist/manifest.json'"},{"fix":"Use npx or install globally: npm install -g crx-compiler.","cause":"Attempting to import crx-compiler as a Node.js module when it is a CLI tool.","error":"TypeError: crx-compiler is not a function"},{"fix":"Use crx-tsc-init instead of crx-tsconfig.","cause":"crx-tsconfig alias is not recognized in newer versions; use crx-tsc-init.","error":"crx-tsconfig: command not found"},{"fix":"Generate keys first with crx-keygen or provide correct path to existing key.","cause":"The specified key file does not exist at the given path.","error":"Error: Private key not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}