@codemoreira/esad 1.3.12 → 1.3.16
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/cli/utils/scaffold.js +12 -0
package/package.json
CHANGED
|
@@ -45,6 +45,18 @@ async function renameProject(targetDir, newName) {
|
|
|
45
45
|
await fs.writeJson(appJsonPath, appJson, { spaces: 2 });
|
|
46
46
|
console.log(`✅ Updated app.json name/slug/package.`);
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
// 3. Update Rspack Config if exists
|
|
50
|
+
const rspackPath = path.join(targetDir, 'rspack.config.mjs');
|
|
51
|
+
if (fs.existsSync(rspackPath)) {
|
|
52
|
+
let content = await fs.readFile(rspackPath, 'utf8');
|
|
53
|
+
const regex = /id:\s*['"][^'"]+['"]/;
|
|
54
|
+
if (regex.test(content)) {
|
|
55
|
+
content = content.replace(regex, `id: '${newName}'`);
|
|
56
|
+
await fs.writeFile(rspackPath, content);
|
|
57
|
+
console.log(`✅ Updated rspack.config.mjs id: ${newName}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
48
60
|
}
|
|
49
61
|
|
|
50
62
|
/**
|