{"id":19458,"library":"electron-webpack-ts","title":"electron-webpack-ts","description":"TypeScript add-on for electron-webpack that enables TypeScript compilation in Electron projects. Current version 4.0.1 requires TypeScript ^3.8.3 as a peer dependency. It integrates with electron-webpack's build pipeline, supporting features like JSX, Vue, and CSS Modules. This package is tied to the electron-webpack ecosystem, which has seen maintenance releases but no recent major updates. Compared to standalone Webpack TypeScript setups, it simplifies configuration by leveraging electron-webpack's convention-based approach.","status":"maintenance","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/electron-userland/electron-webpack","tags":["javascript"],"install":[{"cmd":"npm install electron-webpack-ts","lang":"bash","label":"npm"},{"cmd":"yarn add electron-webpack-ts","lang":"bash","label":"yarn"},{"cmd":"pnpm add electron-webpack-ts","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for TypeScript compilation","package":"typescript","optional":false},{"reason":"Core dependency for the Electron webpack configuration","package":"electron-webpack","optional":true}],"imports":[{"note":"Default export is the configuration function.","wrong":"import * as electronWebpackTs from 'electron-webpack-ts'","symbol":"default","correct":"import electronWebpackTs from 'electron-webpack-ts'"},{"note":"Named export for TypeScript configuration type.","wrong":"import { Config } from 'electron-webpack-ts'","symbol":"Configuration","correct":"import { Configuration } from 'electron-webpack-ts'"},{"note":"CJS require returns the default export.","wrong":"const { default } = require('electron-webpack-ts')","symbol":"require('electron-webpack-ts')","correct":"const electronWebpackTs = require('electron-webpack-ts')"}],"quickstart":{"code":"// Install prerequisites first:\n// npm install --save-dev electron-webpack electron-webpack-ts typescript\n\n// In electron-webpack.config.js:\nconst { createConfig } = require('electron-webpack');\nconst tsConfig = require('electron-webpack-ts');\n\nmodule.exports = function(env) {\n  const config = createConfig(env);\n  config.plugins.push(tsConfig());\n  return config;\n};\n\n// tsconfig.json (required):\n{\n  \"compilerOptions\": {\n    \"target\": \"ES5\",\n    \"module\": \"commonjs\",\n    \"jsx\": \"react\",\n    \"sourceMap\": true,\n    \"outDir\": \"./dist\",\n    \"strict\": true,\n    \"esModuleInterop\": true\n  },\n  \"include\": [\"src/**/*\"]\n}","lang":"javascript","description":"Shows how to integrate electron-webpack-ts with electron-webpack in a configuration file and the required tsconfig.json setup."},"warnings":[{"fix":"Ensure tsconfig.json exists with appropriate compiler options.","message":"You must have a valid tsconfig.json file in your project root for the add-on to work.","severity":"gotcha","affected_versions":">=2.5.0"},{"fix":"Update your code to call the exported function instead of using it as a plugin directly.","message":"Version 3.0.0 dropped support for TypeScript < 3.8.3 and changed the default export signature.","severity":"breaking","affected_versions":">=3.0.0 <4.0.0"},{"fix":"Evaluate alternatives like electron-forge with Vite or esbuild.","message":"electron-webpack is in maintenance mode; consider migrating to a more modern Electron build setup.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Install compatible versions of vue and vue-class-component, and adjust tsconfig.json.","message":"If using Vue, the TypeScript type checker may cause issues; ensure vue-class-component is compatible.","severity":"gotcha","affected_versions":">=2.7.4"},{"fix":"Consult the electron-webpack migration guide for breaking changes in its core API.","message":"Upgrading from electron-webpack v2 to v3 (if using this addon) requires configuration changes.","severity":"breaking","affected_versions":">=2.8.0 <3.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Add 'import React from 'react' in your JSX files or set 'jsx: 'react-jsx' in tsconfig.json.","cause":"TypeScript cannot resolve React types when JSX is enabled but React is not imported.","error":"Cannot find name 'React'"},{"fix":"Ensure electron-webpack-ts is added as a plugin in your electron-webpack.config.js.","cause":"TypeScript files are not being processed because the add-on is not properly configured.","error":"ERROR in ./src/index.tsx\nModule parse failed: Unexpected token (1:8)\nYou may need an appropriate loader to handle this file type."},{"fix":"Run 'npm install --save-dev electron-webpack-ts' and ensure it's in your package.json devDependencies.","cause":"The package is not installed or is in a wrong location.","error":"Cannot find module 'electron-webpack-ts'"},{"fix":"Use: const { createConfig } = require('electron-webpack');","cause":"The import or require statement for electron-webpack is incorrect.","error":"Property 'createConfig' does not exist on type 'typeof import(...)'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}