@depup/react-email 6.9.5-depup.0 → 6.11.0-depup.0
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 +16 -0
- package/README.md +7 -8
- package/changes.json +6 -10
- package/dist/cli/index.mjs +74 -33
- package/package.json +13 -17
- package/readme.md +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# react-email
|
|
2
2
|
|
|
3
|
+
## 6.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0432f96: Use custom esbuild plugins by passing the new `--esbuild-plugins` flag to `email dev`, `email build` and `email export`, so templates that need a custom compile-time transform can be previewed and exported.
|
|
8
|
+
|
|
9
|
+
## 6.10.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- e9939f0: Upgrade `chokidar` to v5, which ships with npm provenance, so installs under pnpm's `trustPolicy: no-downgrade` no longer fail. The CLI now needs Node 20.19 or newer.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 1b45ed0: The dev server now refuses to start on Node older than 20.19, which matches the package's declared minimum, and names the installed version in the error.
|
|
18
|
+
|
|
3
19
|
## 6.9.5
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -13,29 +13,28 @@ npm install @depup/react-email
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [react-email](https://www.npmjs.com/package/react-email) @ 6.
|
|
17
|
-
| Processed | 2026-09-
|
|
16
|
+
| Original | [react-email](https://www.npmjs.com/package/react-email) @ 6.11.0 |
|
|
17
|
+
| Processed | 2026-09-27 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 14 |
|
|
20
20
|
|
|
21
21
|
## Dependency Changes
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
|
-
| @babel/parser | 7.29.2 | ^
|
|
26
|
-
| @babel/traverse | 7.29.0 | ^8.0.
|
|
27
|
-
| chokidar | ^4.0.3 | ^5.0.0 |
|
|
25
|
+
| @babel/parser | 7.29.2 | ^7.29.9 |
|
|
26
|
+
| @babel/traverse | 7.29.0 | ^8.0.6 |
|
|
28
27
|
| commander | ^13.0.0 | ^15.0.0 |
|
|
29
28
|
| conf | ^15.0.2 | ^15.1.0 |
|
|
30
29
|
| debounce | ^2.0.0 | ^3.0.0 |
|
|
31
30
|
| esbuild | ^0.28.0 | ^0.28.2 |
|
|
32
31
|
| jiti | 2.6.1 | ^2.7.0 |
|
|
33
32
|
| log-symbols | ^7.0.0 | ^7.0.1 |
|
|
34
|
-
| marked | ^15.0.12 | ^18.0.
|
|
33
|
+
| marked | ^15.0.12 | ^18.0.14 |
|
|
35
34
|
| mime-types | ^3.0.0 | ^3.0.2 |
|
|
36
35
|
| nypm | 0.6.6 | ^0.6.10 |
|
|
37
36
|
| picospinner | ^3.0.0 | ^3.1.2 |
|
|
38
|
-
| socket.io | ^4.8.1 | ^4.8.
|
|
37
|
+
| socket.io | ^4.8.1 | ^4.8.4 |
|
|
39
38
|
| tailwindcss | ^4.1.18 | ^4.3.3 |
|
|
40
39
|
|
|
41
40
|
---
|
package/changes.json
CHANGED
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
"bumped": {
|
|
3
3
|
"@babel/parser": {
|
|
4
4
|
"from": "7.29.2",
|
|
5
|
-
"to": "^
|
|
5
|
+
"to": "^7.29.9"
|
|
6
6
|
},
|
|
7
7
|
"@babel/traverse": {
|
|
8
8
|
"from": "7.29.0",
|
|
9
|
-
"to": "^8.0.
|
|
10
|
-
},
|
|
11
|
-
"chokidar": {
|
|
12
|
-
"from": "^4.0.3",
|
|
13
|
-
"to": "^5.0.0"
|
|
9
|
+
"to": "^8.0.6"
|
|
14
10
|
},
|
|
15
11
|
"commander": {
|
|
16
12
|
"from": "^13.0.0",
|
|
@@ -38,7 +34,7 @@
|
|
|
38
34
|
},
|
|
39
35
|
"marked": {
|
|
40
36
|
"from": "^15.0.12",
|
|
41
|
-
"to": "^18.0.
|
|
37
|
+
"to": "^18.0.14"
|
|
42
38
|
},
|
|
43
39
|
"mime-types": {
|
|
44
40
|
"from": "^3.0.0",
|
|
@@ -54,13 +50,13 @@
|
|
|
54
50
|
},
|
|
55
51
|
"socket.io": {
|
|
56
52
|
"from": "^4.8.1",
|
|
57
|
-
"to": "^4.8.
|
|
53
|
+
"to": "^4.8.4"
|
|
58
54
|
},
|
|
59
55
|
"tailwindcss": {
|
|
60
56
|
"from": "^4.1.18",
|
|
61
57
|
"to": "^4.3.3"
|
|
62
58
|
}
|
|
63
59
|
},
|
|
64
|
-
"timestamp": "2026-09-
|
|
65
|
-
"totalUpdated":
|
|
60
|
+
"timestamp": "2026-09-27T01:01:16.578Z",
|
|
61
|
+
"totalUpdated": 14
|
|
66
62
|
}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import * as fs$1 from "node:fs";
|
|
|
6
6
|
import fs, { existsSync, promises, statSync } from "node:fs";
|
|
7
7
|
import * as path$2 from "node:path";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import url, { fileURLToPath } from "node:url";
|
|
9
|
+
import url, { fileURLToPath, pathToFileURL } from "node:url";
|
|
10
10
|
import logSymbols from "log-symbols";
|
|
11
11
|
import { addDevDependency, installDependencies, runScript } from "nypm";
|
|
12
12
|
import * as fsp$1 from "node:fs/promises";
|
|
@@ -6533,7 +6533,7 @@ const getTracingRootDir = async (usersProjectLocation) => {
|
|
|
6533
6533
|
//#region package.json
|
|
6534
6534
|
var package_default = {
|
|
6535
6535
|
name: "react-email",
|
|
6536
|
-
version: "6.
|
|
6536
|
+
version: "6.11.0",
|
|
6537
6537
|
description: "A live preview of your emails right in your browser.",
|
|
6538
6538
|
bin: { "email": "./dist/cli/index.mjs" },
|
|
6539
6539
|
type: "module",
|
|
@@ -6565,7 +6565,7 @@ var package_default = {
|
|
|
6565
6565
|
"directory": "packages/react-email"
|
|
6566
6566
|
},
|
|
6567
6567
|
keywords: ["react", "email"],
|
|
6568
|
-
engines: { "node": ">=20.
|
|
6568
|
+
engines: { "node": ">=20.19.0" },
|
|
6569
6569
|
peerDependencies: {
|
|
6570
6570
|
"react": "^18.0 || ^19.0 || ^19.0.0-rc",
|
|
6571
6571
|
"react-dom": "^18.0 || ^19.0 || ^19.0.0-rc"
|
|
@@ -6574,7 +6574,7 @@ var package_default = {
|
|
|
6574
6574
|
"@babel/parser": "catalog:",
|
|
6575
6575
|
"@babel/traverse": "catalog:",
|
|
6576
6576
|
"@react-email/render": "workspace:>=2.1.0",
|
|
6577
|
-
"chokidar": "^
|
|
6577
|
+
"chokidar": "^5.0.0",
|
|
6578
6578
|
"commander": "catalog:",
|
|
6579
6579
|
"conf": "^15.0.2",
|
|
6580
6580
|
"css-tree": "3.2.1",
|
|
@@ -6739,8 +6739,9 @@ const stopSpinnerAndPersist = (spinner, display) => {
|
|
|
6739
6739
|
//#endregion
|
|
6740
6740
|
//#region src/cli/commands/build.ts
|
|
6741
6741
|
const isInReactEmailMonorepo = !path.dirname(fileURLToPath(import.meta.url)).includes("node_modules");
|
|
6742
|
-
const setNextEnvironmentVariablesForBuild = async (emailsDirRelativePath, builtPreviewAppPath, usersProjectLocation) => {
|
|
6742
|
+
const setNextEnvironmentVariablesForBuild = async (emailsDirRelativePath, builtPreviewAppPath, usersProjectLocation, esbuildPluginsPath) => {
|
|
6743
6743
|
const rootDir = await getTracingRootDir(usersProjectLocation);
|
|
6744
|
+
const esbuildPluginsAbsolutePath = esbuildPluginsPath ? path.resolve(usersProjectLocation, esbuildPluginsPath).replaceAll("\\", "/") : void 0;
|
|
6744
6745
|
const nextConfigContents = `
|
|
6745
6746
|
import path from 'path';
|
|
6746
6747
|
const emailsDirRelativePath = path.normalize('${emailsDirRelativePath}');
|
|
@@ -6754,13 +6755,14 @@ const nextConfig = {
|
|
|
6754
6755
|
REACT_EMAIL_INTERNAL_EMAILS_DIR_RELATIVE_PATH: emailsDirRelativePath,
|
|
6755
6756
|
REACT_EMAIL_INTERNAL_EMAILS_DIR_ABSOLUTE_PATH: path.resolve(userProjectLocation, emailsDirRelativePath),
|
|
6756
6757
|
REACT_EMAIL_INTERNAL_PREVIEW_SERVER_LOCATION: previewServerLocation,
|
|
6757
|
-
REACT_EMAIL_INTERNAL_USER_PROJECT_LOCATION: userProjectLocation
|
|
6758
|
+
REACT_EMAIL_INTERNAL_USER_PROJECT_LOCATION: userProjectLocation,
|
|
6759
|
+
${esbuildPluginsAbsolutePath ? `REACT_EMAIL_INTERNAL_ESBUILD_PLUGINS_PATH: '${esbuildPluginsAbsolutePath}',` : ""}
|
|
6758
6760
|
},
|
|
6759
6761
|
turbopack: {
|
|
6760
6762
|
root: rootDir,
|
|
6761
6763
|
},
|
|
6762
6764
|
outputFileTracingRoot: rootDir,
|
|
6763
|
-
serverExternalPackages: ['esbuild'],
|
|
6765
|
+
serverExternalPackages: ['esbuild', 'jiti'],
|
|
6764
6766
|
typescript: {
|
|
6765
6767
|
ignoreBuildErrors: true
|
|
6766
6768
|
},
|
|
@@ -6803,7 +6805,7 @@ const updatePackageJson = async (builtUiPath) => {
|
|
|
6803
6805
|
for (const [dependency, version] of Object.entries(packageJson.devDependencies)) packageJson.devDependencies[dependency] = version.replace("workspace:", "");
|
|
6804
6806
|
await fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJson), "utf8");
|
|
6805
6807
|
};
|
|
6806
|
-
const build$1 = async ({ dir: emailsDirRelativePath, packageManager }) => {
|
|
6808
|
+
const build$1 = async ({ dir: emailsDirRelativePath, packageManager, esbuildPlugins }) => {
|
|
6807
6809
|
if (packageManager) console.warn("The --packageManager option is deprecated and ignored. The build command now just uses npm.");
|
|
6808
6810
|
try {
|
|
6809
6811
|
const usersProjectLocation = process.cwd();
|
|
@@ -6837,7 +6839,7 @@ const build$1 = async ({ dir: emailsDirRelativePath, packageManager }) => {
|
|
|
6837
6839
|
await fs.promises.cp(staticPath, builtStaticDirectory, { recursive: true });
|
|
6838
6840
|
}
|
|
6839
6841
|
spinner.setText("Setting Next environment variables for preview app to work properly");
|
|
6840
|
-
await setNextEnvironmentVariablesForBuild(emailsDirRelativePath, builtPreviewAppPath, usersProjectLocation);
|
|
6842
|
+
await setNextEnvironmentVariablesForBuild(emailsDirRelativePath, builtPreviewAppPath, usersProjectLocation, esbuildPlugins);
|
|
6841
6843
|
spinner.setText("Setting server side generation for the email preview pages");
|
|
6842
6844
|
await forceSSGForEmailPreviews(emailsDirPath, builtPreviewAppPath);
|
|
6843
6845
|
spinner.setText("Updating package.json's build and start scripts");
|
|
@@ -7229,21 +7231,18 @@ const conf = new Conf({
|
|
|
7229
7231
|
});
|
|
7230
7232
|
//#endregion
|
|
7231
7233
|
//#region src/cli/utils/style-text.ts
|
|
7232
|
-
/**
|
|
7233
|
-
* Centralized fallback for Node versions (<20.12.0) without util.styleText.
|
|
7234
|
-
* Returns the original text when styleText is unavailable.
|
|
7235
|
-
*/
|
|
7236
7234
|
const styleText = nodeUtil.styleText ? nodeUtil.styleText : (_, text) => text;
|
|
7237
7235
|
//#endregion
|
|
7238
7236
|
//#region src/cli/utils/preview/get-env-variables-for-preview-app.ts
|
|
7239
|
-
const getEnvVariablesForPreviewApp = (relativePathToEmailsDirectory, previewServerLocation, cwd, resendApiKey, compatibilityClients) => {
|
|
7237
|
+
const getEnvVariablesForPreviewApp = (relativePathToEmailsDirectory, previewServerLocation, cwd, resendApiKey, compatibilityClients, esbuildPluginsPath) => {
|
|
7240
7238
|
return {
|
|
7241
7239
|
REACT_EMAIL_INTERNAL_EMAILS_DIR_RELATIVE_PATH: relativePathToEmailsDirectory,
|
|
7242
7240
|
REACT_EMAIL_INTERNAL_EMAILS_DIR_ABSOLUTE_PATH: path.resolve(cwd, relativePathToEmailsDirectory),
|
|
7243
7241
|
REACT_EMAIL_INTERNAL_PREVIEW_SERVER_LOCATION: previewServerLocation,
|
|
7244
7242
|
REACT_EMAIL_INTERNAL_USER_PROJECT_LOCATION: cwd,
|
|
7245
7243
|
REACT_EMAIL_INTERNAL_RESEND_API_KEY: resendApiKey,
|
|
7246
|
-
...compatibilityClients !== void 0 && { COMPATIBILITY_EMAIL_CLIENTS: compatibilityClients }
|
|
7244
|
+
...compatibilityClients !== void 0 && { COMPATIBILITY_EMAIL_CLIENTS: compatibilityClients },
|
|
7245
|
+
...esbuildPluginsPath !== void 0 && { REACT_EMAIL_INTERNAL_ESBUILD_PLUGINS_PATH: path.resolve(cwd, esbuildPluginsPath) }
|
|
7247
7246
|
};
|
|
7248
7247
|
};
|
|
7249
7248
|
//#endregion
|
|
@@ -7298,10 +7297,10 @@ const safeAsyncServerListen = (server, port) => {
|
|
|
7298
7297
|
});
|
|
7299
7298
|
});
|
|
7300
7299
|
};
|
|
7301
|
-
const startDevServer = async (emailsDirRelativePath, staticBaseDirRelativePath, port, compatibilityClients) => {
|
|
7302
|
-
const [
|
|
7303
|
-
if (
|
|
7304
|
-
console.error(` ${logSymbols.error} Node ${
|
|
7300
|
+
const startDevServer = async (emailsDirRelativePath, staticBaseDirRelativePath, port, compatibilityClients, esbuildPluginsPath) => {
|
|
7301
|
+
const [major = 0, minor = 0] = process.versions.node.split(".").map(Number);
|
|
7302
|
+
if (major < 20 || major === 20 && minor < 19) {
|
|
7303
|
+
console.error(` ${logSymbols.error} Node ${process.versions.node} is not supported. Please upgrade to Node 20.19 or higher.`);
|
|
7305
7304
|
process.exit(1);
|
|
7306
7305
|
}
|
|
7307
7306
|
const previewServerLocation = await getUiLocation();
|
|
@@ -7332,7 +7331,7 @@ const startDevServer = async (emailsDirRelativePath, staticBaseDirRelativePath,
|
|
|
7332
7331
|
} else {
|
|
7333
7332
|
const nextPortToTry = port + 1;
|
|
7334
7333
|
console.warn(` ${logSymbols.warning} Port ${port} is already in use, trying ${nextPortToTry}`);
|
|
7335
|
-
return startDevServer(emailsDirRelativePath, staticBaseDirRelativePath, nextPortToTry, compatibilityClients);
|
|
7334
|
+
return startDevServer(emailsDirRelativePath, staticBaseDirRelativePath, nextPortToTry, compatibilityClients, esbuildPluginsPath);
|
|
7336
7335
|
}
|
|
7337
7336
|
devServer.on("close", async () => {
|
|
7338
7337
|
await app.close();
|
|
@@ -7354,7 +7353,7 @@ const startDevServer = async (emailsDirRelativePath, staticBaseDirRelativePath,
|
|
|
7354
7353
|
process.env = {
|
|
7355
7354
|
NODE_ENV: "development",
|
|
7356
7355
|
...process.env,
|
|
7357
|
-
...getEnvVariablesForPreviewApp(path.normalize(emailsDirRelativePath), previewServerLocation, process.cwd(), conf.get("resendApiKey"), compatibilityClients)
|
|
7356
|
+
...getEnvVariablesForPreviewApp(path.normalize(emailsDirRelativePath), previewServerLocation, process.cwd(), conf.get("resendApiKey"), compatibilityClients, esbuildPluginsPath)
|
|
7358
7357
|
};
|
|
7359
7358
|
if (!process.env.ESBUILD_BINARY_PATH) try {
|
|
7360
7359
|
const esbuild = createJiti(previewServer.esmResolve("esbuild"));
|
|
@@ -7453,13 +7452,13 @@ const tree = async (dirPath, depth) => {
|
|
|
7453
7452
|
};
|
|
7454
7453
|
//#endregion
|
|
7455
7454
|
//#region src/cli/commands/dev.ts
|
|
7456
|
-
const dev = async ({ dir: emailsDirRelativePath, port, clients }) => {
|
|
7455
|
+
const dev = async ({ dir: emailsDirRelativePath, port, clients, esbuildPlugins }) => {
|
|
7457
7456
|
try {
|
|
7458
7457
|
if (!fs.existsSync(emailsDirRelativePath)) {
|
|
7459
7458
|
console.error(`Missing ${emailsDirRelativePath} folder`);
|
|
7460
7459
|
process.exit(1);
|
|
7461
7460
|
}
|
|
7462
|
-
await setupHotreloading(await startDevServer(emailsDirRelativePath, emailsDirRelativePath, Number.parseInt(port, 10), clients), emailsDirRelativePath);
|
|
7461
|
+
await setupHotreloading(await startDevServer(emailsDirRelativePath, emailsDirRelativePath, Number.parseInt(port, 10), clients, esbuildPlugins), emailsDirRelativePath);
|
|
7463
7462
|
} catch (error) {
|
|
7464
7463
|
console.log(error);
|
|
7465
7464
|
process.exit(1);
|
|
@@ -7493,12 +7492,26 @@ const inlineCssLoader = () => ({
|
|
|
7493
7492
|
}
|
|
7494
7493
|
});
|
|
7495
7494
|
//#endregion
|
|
7495
|
+
//#region src/cli/utils/esbuild/load-esbuild-plugins.ts
|
|
7496
|
+
/**
|
|
7497
|
+
* Loads the esbuild plugins a user wants applied when their templates are
|
|
7498
|
+
* bundled. The module's default export is either an array of plugins or a
|
|
7499
|
+
* function returning one, so plugins that need setup can do it lazily.
|
|
7500
|
+
*/
|
|
7501
|
+
const loadEsbuildPlugins = async (modulePath) => {
|
|
7502
|
+
const exported = await createJiti(pathToFileURL(modulePath).href).import(modulePath, { default: true });
|
|
7503
|
+
const plugins = typeof exported === "function" ? await exported() : exported;
|
|
7504
|
+
if (!Array.isArray(plugins)) throw new Error(`Expected the default export of ${modulePath} to be an array of esbuild plugins or a function returning one`);
|
|
7505
|
+
return plugins;
|
|
7506
|
+
};
|
|
7507
|
+
//#endregion
|
|
7496
7508
|
//#region src/cli/utils/esbuild/escape-string-for-regex.ts
|
|
7497
7509
|
function escapeStringForRegex(string) {
|
|
7498
7510
|
return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
7499
7511
|
}
|
|
7500
7512
|
//#endregion
|
|
7501
7513
|
//#region src/cli/utils/esbuild/renderring-utilities-exporter.ts
|
|
7514
|
+
const ENTRY_SUFFIX = "?react-email-entry";
|
|
7502
7515
|
/**
|
|
7503
7516
|
* Made to export the `render` function out of the user's email template
|
|
7504
7517
|
* so that issues like https://github.com/resend/react-email/issues/649 don't
|
|
@@ -7509,17 +7522,39 @@ function escapeStringForRegex(string) {
|
|
|
7509
7522
|
*
|
|
7510
7523
|
* This avoids multiple versions of React being involved, i.e., the version
|
|
7511
7524
|
* in the CLI vs. the version the user has on their emails.
|
|
7525
|
+
*
|
|
7526
|
+
* Each template entry point is replaced by a wrapper module that re-exports
|
|
7527
|
+
* it along with the utilities, instead of loading the template's source here.
|
|
7528
|
+
* The template itself then goes through the regular load pipeline, so other
|
|
7529
|
+
* plugins (for example the user's `--esbuild-plugins`) can still transform it.
|
|
7512
7530
|
*/
|
|
7513
7531
|
const renderingUtilitiesExporter = (emailTemplates) => ({
|
|
7514
7532
|
name: "rendering-utilities-exporter",
|
|
7515
|
-
setup: (b) => {
|
|
7516
|
-
|
|
7533
|
+
setup: async (b) => {
|
|
7534
|
+
const templatePaths = await Promise.all(emailTemplates.map((emailPath) => promises.realpath(emailPath)));
|
|
7535
|
+
const templateFilter = new RegExp(templatePaths.map((templatePath) => escapeStringForRegex(templatePath)).join("|"));
|
|
7536
|
+
b.onResolve({ filter: /.*/ }, async (args) => {
|
|
7537
|
+
if (args.kind !== "entry-point") return null;
|
|
7538
|
+
const resolvedPath = path.isAbsolute(args.path) ? args.path : path.resolve(args.resolveDir, args.path);
|
|
7539
|
+
const realPath = await promises.realpath(resolvedPath);
|
|
7540
|
+
if (!templatePaths.includes(realPath)) return null;
|
|
7517
7541
|
return {
|
|
7518
|
-
|
|
7519
|
-
|
|
7542
|
+
path: realPath,
|
|
7543
|
+
suffix: ENTRY_SUFFIX
|
|
7544
|
+
};
|
|
7545
|
+
});
|
|
7546
|
+
b.onLoad({ filter: templateFilter }, ({ path: pathToFile, suffix }) => {
|
|
7547
|
+
if (suffix !== ENTRY_SUFFIX) return null;
|
|
7548
|
+
const templateSpecifier = JSON.stringify(pathToFile);
|
|
7549
|
+
return {
|
|
7550
|
+
contents: `export * from ${templateSpecifier};
|
|
7551
|
+
import * as emailModule from ${templateSpecifier};
|
|
7552
|
+
export default emailModule.default;
|
|
7553
|
+
export { render } from 'react-email-module-that-will-export-render';
|
|
7520
7554
|
export { createElement as reactEmailCreateReactElement } from 'react';
|
|
7521
7555
|
`,
|
|
7522
|
-
loader:
|
|
7556
|
+
loader: "js",
|
|
7557
|
+
resolveDir: path.dirname(pathToFile)
|
|
7523
7558
|
};
|
|
7524
7559
|
});
|
|
7525
7560
|
b.onResolve({ filter: /^react-email-module-that-will-export-render$/ }, async (args) => {
|
|
@@ -7595,6 +7630,7 @@ const exportTemplates = async (pathToWhereEmailMarkupShouldBeDumped, emailsDirec
|
|
|
7595
7630
|
if (fs.existsSync(pathToWhereEmailMarkupShouldBeDumped)) fs.rmSync(pathToWhereEmailMarkupShouldBeDumped, { recursive: true });
|
|
7596
7631
|
const allTemplates = getEmailTemplatesFromDirectory(emailsDirectoryMetadata);
|
|
7597
7632
|
try {
|
|
7633
|
+
const userPlugins = options.esbuildPlugins ? await loadEsbuildPlugins(path.resolve(process.cwd(), options.esbuildPlugins)) : [];
|
|
7598
7634
|
for (let i = 0; i < allTemplates.length; i += BUILD_BATCH_SIZE) {
|
|
7599
7635
|
const batch = allTemplates.slice(i, i + BUILD_BATCH_SIZE);
|
|
7600
7636
|
await build({
|
|
@@ -7608,7 +7644,11 @@ const exportTemplates = async (pathToWhereEmailMarkupShouldBeDumped, emailsDirec
|
|
|
7608
7644
|
outExtension: { ".js": ".cjs" },
|
|
7609
7645
|
outdir: pathToWhereEmailMarkupShouldBeDumped,
|
|
7610
7646
|
platform: "node",
|
|
7611
|
-
plugins: [
|
|
7647
|
+
plugins: [
|
|
7648
|
+
inlineCssLoader(),
|
|
7649
|
+
renderingUtilitiesExporter(batch),
|
|
7650
|
+
...userPlugins
|
|
7651
|
+
],
|
|
7612
7652
|
write: true
|
|
7613
7653
|
});
|
|
7614
7654
|
await stop();
|
|
@@ -7792,14 +7832,15 @@ if (!requiredFlags.every((flag) => process.execArgv.includes(flag))) spawn(proce
|
|
|
7792
7832
|
});
|
|
7793
7833
|
else {
|
|
7794
7834
|
program.name("react-email").description("A live preview of your emails right in your browser").version(package_default.version);
|
|
7795
|
-
program.command("dev").description("Starts the preview email development app").option("-d, --dir <path>", "Directory with your email templates", "./emails").option("-p --port <port>", "Port to run dev server on", "3000").option("-c, --clients <clients>", "Comma-separated list of email clients to show compatibility warnings for (overrides COMPATIBILITY_EMAIL_CLIENTS)", parseClientsOption).action(dev);
|
|
7796
|
-
program.command("build").description("Copies the preview app for onto .react-email and builds it").option("-d, --dir <path>", "Directory with your email templates", "./emails").addOption(new Option("-p, --packageManager <name>").hideHelp()).action(build$1);
|
|
7835
|
+
program.command("dev").description("Starts the preview email development app").option("-d, --dir <path>", "Directory with your email templates", "./emails").option("-p --port <port>", "Port to run dev server on", "3000").option("-c, --clients <clients>", "Comma-separated list of email clients to show compatibility warnings for (overrides COMPATIBILITY_EMAIL_CLIENTS)", parseClientsOption).option("--esbuild-plugins <path>", "Path to a module whose default export is an array of esbuild plugins (or a function returning one) applied when bundling email templates").action(dev);
|
|
7836
|
+
program.command("build").description("Copies the preview app for onto .react-email and builds it").option("-d, --dir <path>", "Directory with your email templates", "./emails").addOption(new Option("-p, --packageManager <name>").hideHelp()).option("--esbuild-plugins <path>", "Path to a module whose default export is an array of esbuild plugins (or a function returning one) applied when bundling email templates").action(build$1);
|
|
7797
7837
|
program.command("start").description("Runs the built preview app that is inside of \".react-email\"").action(start);
|
|
7798
|
-
program.command("export").description("Build the templates to the `out` directory").option("--outDir <path>", "Output directory", "out").option("-p, --pretty", "Pretty print the output", false).option("-t, --plainText", "Set output format as plain text", false).option("-d, --dir <path>", "Directory with your email templates", "./emails").option("-e, --extension <extension>", "Set a custom file extension for rendered emails (e.g. blade.php)").option("-s, --silent", "To, or not to show a spinner with process information", false).action(({ outDir, pretty, plainText, silent, dir: srcDir, extension }) => exportTemplates(outDir, srcDir, {
|
|
7838
|
+
program.command("export").description("Build the templates to the `out` directory").option("--outDir <path>", "Output directory", "out").option("-p, --pretty", "Pretty print the output", false).option("-t, --plainText", "Set output format as plain text", false).option("-d, --dir <path>", "Directory with your email templates", "./emails").option("-e, --extension <extension>", "Set a custom file extension for rendered emails (e.g. blade.php)").option("-s, --silent", "To, or not to show a spinner with process information", false).option("--esbuild-plugins <path>", "Path to a module whose default export is an array of esbuild plugins (or a function returning one) applied when bundling email templates").action(({ outDir, pretty, plainText, silent, dir: srcDir, extension, esbuildPlugins }) => exportTemplates(outDir, srcDir, {
|
|
7799
7839
|
silent,
|
|
7800
7840
|
plainText,
|
|
7801
7841
|
pretty,
|
|
7802
|
-
extension
|
|
7842
|
+
extension,
|
|
7843
|
+
esbuildPlugins
|
|
7803
7844
|
}));
|
|
7804
7845
|
const resend = program.command("resend");
|
|
7805
7846
|
resend.command("setup").description("Sets up the integration between the React Email CLI, and your Resend account through an API Key").action(resendSetup);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/react-email",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.11.0-depup.0",
|
|
4
4
|
"description": "A live preview of your emails right in your browser. (with updated dependencies)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"email": "./dist/cli/index.mjs"
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"email"
|
|
36
36
|
],
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": ">=20.
|
|
38
|
+
"node": ">=20.19.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^18.0 || ^19.0 || ^19.0.0-rc",
|
|
42
42
|
"react-dom": "^18.0 || ^19.0 || ^19.0.0-rc"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@babel/parser": "^
|
|
46
|
-
"@babel/traverse": "^8.0.
|
|
45
|
+
"@babel/parser": "^7.29.9",
|
|
46
|
+
"@babel/traverse": "^8.0.6",
|
|
47
47
|
"@react-email/render": ">=2.1.0",
|
|
48
48
|
"chokidar": "^5.0.0",
|
|
49
49
|
"commander": "^15.0.0",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"glob": "^13.0.6",
|
|
55
55
|
"jiti": "^2.7.0",
|
|
56
56
|
"log-symbols": "^7.0.1",
|
|
57
|
-
"marked": "^18.0.
|
|
57
|
+
"marked": "^18.0.14",
|
|
58
58
|
"mime-types": "^3.0.2",
|
|
59
59
|
"normalize-path": "^3.0.0",
|
|
60
60
|
"nypm": "^0.6.10",
|
|
61
61
|
"picospinner": "^3.1.2",
|
|
62
62
|
"prismjs": "^1.30.0",
|
|
63
63
|
"prompts": "2.4.2",
|
|
64
|
-
"socket.io": "^4.8.
|
|
64
|
+
"socket.io": "^4.8.4",
|
|
65
65
|
"tailwindcss": "^4.3.3",
|
|
66
66
|
"tsconfig-paths": "4.2.0"
|
|
67
67
|
},
|
|
@@ -96,15 +96,11 @@
|
|
|
96
96
|
"changes": {
|
|
97
97
|
"@babel/parser": {
|
|
98
98
|
"from": "7.29.2",
|
|
99
|
-
"to": "^
|
|
99
|
+
"to": "^7.29.9"
|
|
100
100
|
},
|
|
101
101
|
"@babel/traverse": {
|
|
102
102
|
"from": "7.29.0",
|
|
103
|
-
"to": "^8.0.
|
|
104
|
-
},
|
|
105
|
-
"chokidar": {
|
|
106
|
-
"from": "^4.0.3",
|
|
107
|
-
"to": "^5.0.0"
|
|
103
|
+
"to": "^8.0.6"
|
|
108
104
|
},
|
|
109
105
|
"commander": {
|
|
110
106
|
"from": "^13.0.0",
|
|
@@ -132,7 +128,7 @@
|
|
|
132
128
|
},
|
|
133
129
|
"marked": {
|
|
134
130
|
"from": "^15.0.12",
|
|
135
|
-
"to": "^18.0.
|
|
131
|
+
"to": "^18.0.14"
|
|
136
132
|
},
|
|
137
133
|
"mime-types": {
|
|
138
134
|
"from": "^3.0.0",
|
|
@@ -148,17 +144,17 @@
|
|
|
148
144
|
},
|
|
149
145
|
"socket.io": {
|
|
150
146
|
"from": "^4.8.1",
|
|
151
|
-
"to": "^4.8.
|
|
147
|
+
"to": "^4.8.4"
|
|
152
148
|
},
|
|
153
149
|
"tailwindcss": {
|
|
154
150
|
"from": "^4.1.18",
|
|
155
151
|
"to": "^4.3.3"
|
|
156
152
|
}
|
|
157
153
|
},
|
|
158
|
-
"depsUpdated":
|
|
154
|
+
"depsUpdated": 14,
|
|
159
155
|
"originalPackage": "react-email",
|
|
160
|
-
"originalVersion": "6.
|
|
161
|
-
"processedAt": "2026-09-
|
|
156
|
+
"originalVersion": "6.11.0",
|
|
157
|
+
"processedAt": "2026-09-27T01:01:23.007Z",
|
|
162
158
|
"smokeTest": "failed"
|
|
163
159
|
}
|
|
164
160
|
}
|
package/readme.md
CHANGED
|
@@ -30,6 +30,14 @@ Starts a local development server that will watch your files and automatically r
|
|
|
30
30
|
npx react-email dev
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
Templates are bundled with [esbuild](https://esbuild.github.io/). To run additional esbuild plugins, for example a compile-time transform your templates depend on, pass `--esbuild-plugins` with the path to a module whose default export is an array of plugins (or a function returning one):
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npx react-email dev --esbuild-plugins ./esbuild-plugins.mjs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The same option is accepted by `email build` and `email export`.
|
|
40
|
+
|
|
33
41
|
### `email export`
|
|
34
42
|
|
|
35
43
|
Generates the plain HTML files of your emails into a `out` directory.
|