#8639·capacitor

[Bug]: test

Author: sandstromCreated Oct 1, 2026Updated Oct 1, 2026
Labelstriage

Added based on request from Eric Horodyski

https://outsystems.canny.io/capacitor-feature-requests/p/support-esm-projects-type-module-when-loading-capacitorconfigts

Request

Add first-class support for loading capacitor.config.ts in packages that have "type": "module" in their package.json.

Why

More and more teams are migrating their codebases to ESM.

Today, a package that contains a Capacitor app cannot opt into "type": "module" because Capacitor's config loader is CommonJS-only — it transpiles the TS config to CJS and loads it via require(). The moment the package is typed as a module, Node classifies every .ts file as ESM and the loader path breaks before user code runs.

The only workarounds are to keep the Capacitor app (and everything next to it) on CommonJS, or to use escape hatches like .cts / .mts extensions and scoped type: "commonjs" overrides. None of these are acceptable for teams going all-in on ESM.

Impact

Unblocks the ESM migration for every team using Capacitor, and brings the CLI in line with the broader Node and TypeScript ecosystem.