Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jsx-email): dont declare exports for cjs build. fixes #235 #236

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/jsx-email/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
return mod;
} catch (e) {
try {
return require(id);

Check warning on line 200 in packages/jsx-email/src/config.ts

View workflow job for this annotation

GitHub Actions / Validate

Unexpected require()

Check warning on line 200 in packages/jsx-email/src/config.ts

View workflow job for this annotation

GitHub Actions / Validate

Calls to require() should use string literals
} catch (error) {
if (
(error as any).code === 'ERR_REQUIRE_ESM' ||
Expand Down Expand Up @@ -239,8 +239,9 @@

log.debug('loadConfig →', { cwd: process.cwd(), searchResult, startDir });

const exports: ConfigExports = searchResult?.config ?? {};
const intermediate = exports.config instanceof Promise ? await exports.config : exports.config;
const configExports: ConfigExports = searchResult?.config ?? {};
const intermediate =
configExports.config instanceof Promise ? await configExports.config : configExports.config;
const config = intermediate ?? { ...defaults };

if ((config as any).symbol === configSymbol) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/.snapshots/create-jsx-email.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`create-jsx-email > command 1`] = `
"
create-jsx-email v2.0.3
create-jsx-email v2.0.4

The fastest way to get started with JSX Email

Expand Down
Loading