create-rsbuild 1.0.0-alpha.0 → 1.0.0-alpha.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/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1358,9 +1358,15 @@ function copyFolder(src, dist, version, name) {
|
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
+
var isStableVersion = (version) => {
|
|
1362
|
+
return ["alpha", "beta", "rc", "canary", "nightly"].every(
|
|
1363
|
+
(tag) => !version.includes(tag)
|
|
1364
|
+
);
|
|
1365
|
+
};
|
|
1361
1366
|
var updatePackageJson = (pkgJsonPath, version, name) => {
|
|
1362
1367
|
let content = fs.readFileSync(pkgJsonPath, "utf-8");
|
|
1363
|
-
|
|
1368
|
+
const targetVersion = isStableVersion(version) ? `^${version}` : version;
|
|
1369
|
+
content = content.replace(/workspace:\*/g, targetVersion);
|
|
1364
1370
|
const pkg = JSON.parse(content);
|
|
1365
1371
|
if (name && name !== ".") {
|
|
1366
1372
|
pkg.name = name;
|