juice-email-cli 2.4.0 → 2.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juice-email-cli",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "type": "module",
5
5
  "description": "CLI tool to generate email-client-compatible HTML with juice (CSS inlining) + Mustache templating + minification",
6
6
  "main": "src/index.js",
package/src/init.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
  import chalk from 'chalk';
4
5
  import {
5
6
  resolveEdmDir, loadMeta, findBrands, findTemplateVersions,
@@ -7,6 +8,8 @@ import {
7
8
  promptOutputName,
8
9
  } from './snippet.js';
9
10
 
11
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
+
10
13
  function fmtBytes(b) {
11
14
  return b < 1024 ? `${b} B` : `${(b / 1024).toFixed(1)} KB`;
12
15
  }
package/src/snippet.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
3
  import os from 'os';
4
+ import { fileURLToPath } from 'url';
4
5
  import juice from 'juice';
5
6
  import Mustache from 'mustache';
6
7
  import chalk from 'chalk';
@@ -14,6 +15,8 @@ import {
14
15
  DEFAULT_CONFIG_PATH,
15
16
  } from './index.js';
16
17
 
18
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
19
+
17
20
  // ─── EDM 目录解析 ──────────────────────────────────────────────────────────────
18
21
 
19
22
  function resolveEdmDir() {