react-email 5.2.7 → 5.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +8 -2
- package/package.json +2 -2
- package/src/utils/preview/start-dev-server.ts +18 -0
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -27,10 +27,10 @@ import { parse } from "@babel/parser";
|
|
|
27
27
|
import traverseModule from "@babel/traverse";
|
|
28
28
|
import { createMatchPath, loadConfig } from "tsconfig-paths";
|
|
29
29
|
import http from "node:http";
|
|
30
|
+
import os from "node:os";
|
|
30
31
|
import Conf from "conf";
|
|
31
32
|
import * as nodeUtil from "node:util";
|
|
32
33
|
import { lookup } from "mime-types";
|
|
33
|
-
import os from "node:os";
|
|
34
34
|
import { build } from "esbuild";
|
|
35
35
|
import { glob } from "glob";
|
|
36
36
|
import normalize$1 from "normalize-path";
|
|
@@ -6360,7 +6360,7 @@ const getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFil
|
|
|
6360
6360
|
//#region package.json
|
|
6361
6361
|
var package_default = {
|
|
6362
6362
|
name: "react-email",
|
|
6363
|
-
version: "5.2.
|
|
6363
|
+
version: "5.2.9",
|
|
6364
6364
|
description: "A live preview of your emails right in your browser.",
|
|
6365
6365
|
bin: { "email": "./dist/index.js" },
|
|
6366
6366
|
type: "module",
|
|
@@ -6974,6 +6974,12 @@ const startDevServer = async (emailsDirRelativePath, staticBaseDirRelativePath,
|
|
|
6974
6974
|
...process.env,
|
|
6975
6975
|
...getEnvVariablesForPreviewApp(path.normalize(emailsDirRelativePath), previewServerLocation, process.cwd(), conf.get("resendApiKey"))
|
|
6976
6976
|
};
|
|
6977
|
+
if (!process.env.ESBUILD_BINARY_PATH) try {
|
|
6978
|
+
const esbuild = createJiti(previewServer.esmResolve("esbuild"));
|
|
6979
|
+
const subpath = process.platform === "win32" ? "esbuild.exe" : "bin/esbuild";
|
|
6980
|
+
const esbuildBinaryPath = url.fileURLToPath(esbuild.esmResolve(`@esbuild/${process.platform}-${os.arch()}/${subpath}`));
|
|
6981
|
+
process.env.ESBUILD_BINARY_PATH = esbuildBinaryPath;
|
|
6982
|
+
} catch (_exception) {}
|
|
6977
6983
|
const app = (await previewServer.import("next", { default: true }))({
|
|
6978
6984
|
dev: false,
|
|
6979
6985
|
conf: { images: { unoptimized: true } },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-email",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.9",
|
|
4
4
|
"description": "A live preview of your emails right in your browser.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"email": "./dist/index.js"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"shlex": "3.0.0",
|
|
50
50
|
"tsx": "4.21.0",
|
|
51
51
|
"typescript": "5.8.3",
|
|
52
|
-
"@react-email/components": "1.0.
|
|
52
|
+
"@react-email/components": "1.0.8"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsdown",
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { existsSync, promises as fs } from 'node:fs';
|
|
1
2
|
import http from 'node:http';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
import os from 'node:os';
|
|
2
5
|
import path from 'node:path';
|
|
3
6
|
import url from 'node:url';
|
|
4
7
|
import { createJiti } from 'jiti';
|
|
@@ -135,6 +138,21 @@ export const startDevServer = async (
|
|
|
135
138
|
conf.get('resendApiKey'),
|
|
136
139
|
),
|
|
137
140
|
};
|
|
141
|
+
if (!process.env.ESBUILD_BINARY_PATH) {
|
|
142
|
+
try {
|
|
143
|
+
const esbuild = createJiti(previewServer.esmResolve('esbuild'));
|
|
144
|
+
const subpath =
|
|
145
|
+
process.platform === 'win32' ? 'esbuild.exe' : 'bin/esbuild';
|
|
146
|
+
const esbuildBinaryPath = url.fileURLToPath(
|
|
147
|
+
esbuild.esmResolve(
|
|
148
|
+
`@esbuild/${process.platform}-${os.arch()}/${subpath}`,
|
|
149
|
+
),
|
|
150
|
+
);
|
|
151
|
+
process.env.ESBUILD_BINARY_PATH = esbuildBinaryPath;
|
|
152
|
+
} catch (_exception) {
|
|
153
|
+
// Optional: platform binary may be missing; esbuild will use its default resolution.
|
|
154
|
+
}
|
|
155
|
+
}
|
|
138
156
|
|
|
139
157
|
const next = await previewServer.import<typeof import('next')['default']>(
|
|
140
158
|
'next',
|