Registry / web-framework / electron-webpack-ts

electron-webpack-ts

JSON →
library4.0.1jsnpmunverified

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.

npm install electron-webpack-ts
INSTALL
IMPORT
SIG · ELECTRON-WEBPACK-T
E
electron-webpack-ts
web-frameworkjavascriptv4.0.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import electronWebpackTs from 'electron-webpack-ts'
✗ import * as electronWebpackTs from 'electron-webpack-ts'
Default export is the configuration function.
Configuration
✓ import { Configuration } from 'electron-webpack-ts'
✗ import { Config } from 'electron-webpack-ts'
Named export for TypeScript configuration type.
require('electron-webpack-ts')
✓ const electronWebpackTs = require('electron-webpack-ts')
✗ const { default } = require('electron-webpack-ts')
CJS require returns the default export.

Shows how to integrate electron-webpack-ts with electron-webpack in a configuration file and the required tsconfig.json setup.

// Install prerequisites first: // npm install --save-dev electron-webpack electron-webpack-ts typescript // In electron-webpack.config.js: const { createConfig } = require('electron-webpack'); const tsConfig = require('electron-webpack-ts'); module.exports = function(env) { const config = createConfig(env); config.plugins.push(tsConfig()); return config; }; // tsconfig.json (required): { "compilerOptions": { "target": "ES5", "module": "commonjs", "jsx": "react", "sourceMap": true, "outDir": "./dist", "strict": true, "esModuleInterop": true }, "include": ["src/**/*"] }
Debug
Known issues
gotchaYou must have a valid tsconfig.json file in your project root for the add-on to work.
fix
Ensure tsconfig.json exists with appropriate compiler options.
affects: >=2.5.0
breakingVersion 3.0.0 dropped support for TypeScript < 3.8.3 and changed the default export signature.
fix
Update your code to call the exported function instead of using it as a plugin directly.
affects: >=3.0.0 <4.0.0
deprecatedelectron-webpack is in maintenance mode; consider migrating to a more modern Electron build setup.
fix
Evaluate alternatives like electron-forge with Vite or esbuild.
affects: >=0.0.0
gotchaIf using Vue, the TypeScript type checker may cause issues; ensure vue-class-component is compatible.
fix
Install compatible versions of vue and vue-class-component, and adjust tsconfig.json.
affects: >=2.7.4
breakingUpgrading from electron-webpack v2 to v3 (if using this addon) requires configuration changes.
fix
Consult the electron-webpack migration guide for breaking changes in its core API.
affects: >=2.8.0 <3.0.0
Errors
Common errors & fixes
Cannot find name 'React'
TypeScript cannot resolve React types when JSX is enabled but React is not imported.
fix
Add 'import React from 'react' in your JSX files or set 'jsx: 'react-jsx' in tsconfig.json.
ERROR in ./src/index.tsx Module parse failed: Unexpected token (1:8) You may need an appropriate loader to handle this file type.
TypeScript files are not being processed because the add-on is not properly configured.
fix
Ensure electron-webpack-ts is added as a plugin in your electron-webpack.config.js.
Cannot find module 'electron-webpack-ts'
The package is not installed or is in a wrong location.
fix
Run 'npm install --save-dev electron-webpack-ts' and ensure it's in your package.json devDependencies.
Property 'createConfig' does not exist on type 'typeof import(...)'.
The import or require statement for electron-webpack is incorrect.
fix
Use: const { createConfig } = require('electron-webpack');
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency required for TypeScript compilation
electron-webpackoptionalCore dependency for the Electron webpack configuration
Agent activity
4 hits · last 30 days
node
4
Resources
electron-webpack-ts — npm install electron-webpack-ts · libregistry