@nasti-toolchain/nasti 1.3.8 → 1.3.10
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/cli.cjs +18 -8
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +18 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +17 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -812,7 +812,8 @@ function rewriteExternalRequires(code) {
|
|
|
812
812
|
const imports = [];
|
|
813
813
|
for (const pkg of pkgs) {
|
|
814
814
|
const safe = pkg.replace(/[^a-zA-Z0-9_$]/g, "_");
|
|
815
|
-
imports.push(`import
|
|
815
|
+
imports.push(`import * as __ns_${safe} from "/@modules/${pkg}";`);
|
|
816
|
+
imports.push(`var __req_${safe} = "default" in __ns_${safe} ? __ns_${safe}["default"] : __ns_${safe};`);
|
|
816
817
|
result = result.replaceAll(`__require("${pkg}")`, `__req_${safe}`);
|
|
817
818
|
result = result.replaceAll(`__require('${pkg}')`, `__req_${safe}`);
|
|
818
819
|
}
|
|
@@ -899,10 +900,19 @@ function resolveNodeModule(root, moduleName) {
|
|
|
899
900
|
if (resolved) return resolved;
|
|
900
901
|
}
|
|
901
902
|
if (subpath) {
|
|
902
|
-
const
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
903
|
+
const subDirs = [""];
|
|
904
|
+
for (const field of ["module", "main"]) {
|
|
905
|
+
if (typeof pkg[field] === "string") {
|
|
906
|
+
const dir2 = import_node_path4.default.dirname(pkg[field]);
|
|
907
|
+
if (dir2 && dir2 !== "." && !subDirs.includes(dir2)) subDirs.push(dir2);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
for (const dir2 of subDirs) {
|
|
911
|
+
const direct = import_node_path4.default.join(pkgDir, dir2, subpath);
|
|
912
|
+
if (import_node_fs4.default.existsSync(direct) && import_node_fs4.default.statSync(direct).isFile()) return direct;
|
|
913
|
+
for (const ext of RESOLVE_EXTENSIONS) {
|
|
914
|
+
if (import_node_fs4.default.existsSync(direct + ext)) return direct + ext;
|
|
915
|
+
}
|
|
906
916
|
}
|
|
907
917
|
return null;
|
|
908
918
|
}
|
|
@@ -1436,7 +1446,7 @@ async function createServer(inlineConfig = {}) {
|
|
|
1436
1446
|
const localUrl = `http://localhost:${actualPort}`;
|
|
1437
1447
|
const networkUrl = host === "0.0.0.0" ? `http://${getNetworkAddress()}:${actualPort}` : null;
|
|
1438
1448
|
console.log();
|
|
1439
|
-
console.log(import_picocolors.default.cyan(" nasti dev server") + import_picocolors.default.dim(` v${"1.3.
|
|
1449
|
+
console.log(import_picocolors.default.cyan(" nasti dev server") + import_picocolors.default.dim(` v${"1.3.10"}`));
|
|
1440
1450
|
console.log();
|
|
1441
1451
|
console.log(` ${import_picocolors.default.green(">")} Local: ${import_picocolors.default.cyan(localUrl)}`);
|
|
1442
1452
|
if (networkUrl) {
|
|
@@ -1514,7 +1524,7 @@ __export(build_exports, {
|
|
|
1514
1524
|
async function build(inlineConfig = {}) {
|
|
1515
1525
|
const config = await resolveConfig(inlineConfig, "build");
|
|
1516
1526
|
const startTime = performance.now();
|
|
1517
|
-
console.log(import_picocolors2.default.cyan("\n\u{1F528} nasti build") + import_picocolors2.default.dim(` v${"1.3.
|
|
1527
|
+
console.log(import_picocolors2.default.cyan("\n\u{1F528} nasti build") + import_picocolors2.default.dim(` v${"1.3.10"}`));
|
|
1518
1528
|
console.log(import_picocolors2.default.dim(` root: ${config.root}`));
|
|
1519
1529
|
console.log(import_picocolors2.default.dim(` mode: ${config.mode}`));
|
|
1520
1530
|
const outDir = import_node_path10.default.resolve(config.root, config.build.outDir);
|
|
@@ -1739,6 +1749,6 @@ cli.command("preview [root]", "Preview production build").option("--port <port>"
|
|
|
1739
1749
|
}
|
|
1740
1750
|
});
|
|
1741
1751
|
cli.help();
|
|
1742
|
-
cli.version("1.3.
|
|
1752
|
+
cli.version("1.3.10");
|
|
1743
1753
|
cli.parse();
|
|
1744
1754
|
//# sourceMappingURL=cli.cjs.map
|