@suronai/cli 0.1.22 → 0.1.23
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 +1 -1
- package/src/commands/init.js +1 -1
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -183,7 +183,7 @@ async function patchEntryPoint(cwd, isEsm) {
|
|
|
183
183
|
try { src = readFileSync(entryPath, "utf-8"); } catch { return; }
|
|
184
184
|
|
|
185
185
|
// Build regex patterns for both dotenv styles
|
|
186
|
-
const esmPattern = /^import\s+\{\s*config\s*\}\s+from\s+["']dotenv["']
|
|
186
|
+
const esmPattern = /^import\s+\{\s*config\s*\}\s+from\s+["']dotenv["'];?[ \t]*(?:\r?\n[ \t]*)*config\(\);?/m;
|
|
187
187
|
const cjsPattern = /^(?:const\s+)?require\(["']dotenv["']\)\.config\(\);?/m;
|
|
188
188
|
const pattern = isEsm ? esmPattern : cjsPattern;
|
|
189
189
|
|