{"id":25198,"library":"electron-compilers","title":"Electron Compilers","description":"Provides compiler implementations (Babel, TypeScript, CoffeeScript, GraphQL, LESS, Stylus, Jade, CSON) for electron-compile in Electron apps. Current stable version is 5.9.0, but the package is in maintenance mode and tightly coupled to the deprecated electron-compile ecosystem. Key differentiator: designed to be a devDependency to avoid bloating production builds. Not actively developed; users are strongly advised to migrate to modern Electron tooling (e.g., Webpack, Vite).","status":"maintenance","version":"5.9.0","language":"javascript","source_language":"en","source_url":"https://github.com/paulcbetts/electron-compilers","tags":["javascript","electron"],"install":[{"cmd":"npm install electron-compilers","lang":"bash","label":"npm"},{"cmd":"yarn add electron-compilers","lang":"bash","label":"yarn"},{"cmd":"pnpm add electron-compilers","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM and CJS both supported; named export works with destructuring.","wrong":"const BabelCompiler = require('electron-compilers').BabelCompiler","symbol":"BabelCompiler","correct":"import { BabelCompiler } from 'electron-compilers'"},{"note":"Not a default export; must use named import.","wrong":"import TypeScriptCompiler from 'electron-compilers'","symbol":"TypeScriptCompiler","correct":"import { TypeScriptCompiler } from 'electron-compilers'"},{"note":"CommonJS require is also valid; the export is named 'CoffeeScriptCompiler', not 'CoffeeScript'.","wrong":"import { CoffeeScript } from 'electron-compilers'","symbol":"CoffeeScriptCompiler","correct":"const { CoffeeScriptCompiler } = require('electron-compilers')"}],"quickstart":{"code":"import { BabelCompiler } from 'electron-compilers';\nimport { CompilerHost } from 'electron-compile';\n\nconst compiler = new BabelCompiler({\n  babelConfig: {\n    presets: ['@babel/preset-env', '@babel/preset-react']\n  }\n});\n\nconst host = new CompilerHost({\n  compiler,\n  cacheDir: './.compiler-cache'\n});\n\nhost.compile('/path/to/input.js', 'path/to/output.js')\n  .then(result => console.log('Compiled successfully', result))\n  .catch(err => console.error('Compilation failed', err));","lang":"typescript","description":"Shows how to instantiate the BabelCompiler and use it with electron-compile's CompilerHost to compile a file."},"warnings":[{"fix":"Migrate to a modern build tool like Webpack, Rollup, or Vite.","message":"The entire electron-compile ecosystem is deprecated. electron-compilers will not receive updates for modern compilers (e.g., Babel 7+).","severity":"deprecated","affected_versions":"*"},{"fix":"Update presets/plugins to Babel 6 compatible versions (e.g., 'babel-preset-es2015' -> '@babel/preset-env' with additional packages).","message":"Version 5.0 removed support for Babel 5 and switched to Babel 6. Existing code relying on Babel 5 presets will break.","severity":"breaking","affected_versions":">=5.0 <=5.9.0"},{"fix":"If using TypeScript >=3, consider using tsc directly instead of this compiler.","message":"TypeScript compiler may not support all TypeScript 4+ features; only tested with TypeScript 2.x.","severity":"gotcha","affected_versions":">=5.0 <=5.9.0"},{"fix":"Use pug directly instead of the Jade compiler; or pin an old jade version.","message":"The Jade compiler expects the jade package, but jade was renamed to pug. The package uses the deprecated 'jade' npm package.","severity":"gotcha","affected_versions":"*"},{"fix":"Process .graphql files with a current version of graphql-tag instead of relying on this compiler.","message":"GraphQL compiler uses an outdated graphql-tag version; may not parse modern GraphQL schema syntax.","severity":"breaking","affected_versions":">=5.0 <=5.9.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install the required Babel version: npm install babel-core@6.26.3 (for v5) or check README.","cause":"electron-compilers expects babel-core installed as a peer dependency, but it may be missing or mismatched.","error":"Error: Cannot find module 'babel-core'"},{"fix":"Install typescript: npm install typescript@2.9.2 (or version compatible with your project).","cause":"TypeScript compiler requires the typescript package installed but it is not declared as a dependency.","error":"Cannot find module 'typescript'"},{"fix":"Provide a valid babelConfig object with presets/plugins (e.g., { presets: ['env'] }).","cause":"The BabelCompiler is initialized without a babelConfig or with invalid config, so babel is not properly set up.","error":"TypeError: Cannot read property 'transpile' of undefined"},{"fix":"If you need Jade support, install jade (npm install jade). Better: use pug instead.","cause":"Jade is deprecated and may not be installed; the compiler looks for a 'jade' module.","error":"Compiler 'jade' not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}