@nasti-toolchain/nasti 1.5.1 → 1.6.0
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 +31 -14
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +31 -14
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +31 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -763,9 +763,17 @@ function getReactRefreshRuntimeEsm() {
|
|
|
763
763
|
if (__refreshRuntimeCache) return __refreshRuntimeCache;
|
|
764
764
|
let cjsPath;
|
|
765
765
|
try {
|
|
766
|
-
|
|
767
|
-
|
|
766
|
+
const pkgPath = __require.resolve("react-refresh/package.json");
|
|
767
|
+
cjsPath = import_node_path4.default.join(import_node_path4.default.dirname(pkgPath), "cjs", "react-refresh-runtime.development.js");
|
|
768
|
+
} catch (err) {
|
|
768
769
|
cjsPath = import_node_path4.default.resolve(__dirname_esm, "../../node_modules/react-refresh/cjs/react-refresh-runtime.development.js");
|
|
770
|
+
if (!import_node_fs4.default.existsSync(cjsPath)) {
|
|
771
|
+
const origMsg = err instanceof Error ? err.message : String(err);
|
|
772
|
+
throw new Error(
|
|
773
|
+
`[nasti] Missing dependency "react-refresh". Install it with: npm install react-refresh
|
|
774
|
+
Original resolve error: ${origMsg}`
|
|
775
|
+
);
|
|
776
|
+
}
|
|
769
777
|
}
|
|
770
778
|
const cjsSource = import_node_fs4.default.readFileSync(cjsPath, "utf-8");
|
|
771
779
|
__refreshRuntimeCache = `// Wrapped react-refresh runtime -> ESM
|
|
@@ -1616,12 +1624,19 @@ async function createServer(inlineConfig = {}) {
|
|
|
1616
1624
|
app.use((0, import_sirv.default)(config.root, { dev: true, etag: true }));
|
|
1617
1625
|
const httpServer = import_node_http.default.createServer(app);
|
|
1618
1626
|
const ws = createWebSocketServer(httpServer);
|
|
1627
|
+
const ignoredSegments = /* @__PURE__ */ new Set(["node_modules", ".git", ".nasti"]);
|
|
1628
|
+
const outDirAbs = import_node_path9.default.resolve(config.root, config.build.outDir);
|
|
1619
1629
|
const watcher = (0, import_chokidar.watch)(config.root, {
|
|
1620
|
-
ignored:
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1630
|
+
ignored: (filePath) => {
|
|
1631
|
+
if (filePath === config.root) return false;
|
|
1632
|
+
if (filePath === outDirAbs || filePath.startsWith(outDirAbs + import_node_path9.default.sep)) return true;
|
|
1633
|
+
const rel = import_node_path9.default.relative(config.root, filePath);
|
|
1634
|
+
if (!rel || rel.startsWith("..") || import_node_path9.default.isAbsolute(rel)) return false;
|
|
1635
|
+
for (const seg of rel.split(import_node_path9.default.sep)) {
|
|
1636
|
+
if (ignoredSegments.has(seg)) return true;
|
|
1637
|
+
}
|
|
1638
|
+
return false;
|
|
1639
|
+
},
|
|
1625
1640
|
ignoreInitial: true
|
|
1626
1641
|
});
|
|
1627
1642
|
let server;
|
|
@@ -1649,7 +1664,7 @@ async function createServer(inlineConfig = {}) {
|
|
|
1649
1664
|
const localUrl = `http://localhost:${actualPort}`;
|
|
1650
1665
|
const networkUrl = host === "0.0.0.0" ? `http://${getNetworkAddress()}:${actualPort}` : null;
|
|
1651
1666
|
console.log();
|
|
1652
|
-
console.log(import_picocolors.default.cyan(" nasti dev server") + import_picocolors.default.dim(` v${"1.
|
|
1667
|
+
console.log(import_picocolors.default.cyan(" nasti dev server") + import_picocolors.default.dim(` v${"1.6.0"}`));
|
|
1653
1668
|
console.log();
|
|
1654
1669
|
console.log(` ${import_picocolors.default.green(">")} Local: ${import_picocolors.default.cyan(localUrl)}`);
|
|
1655
1670
|
if (networkUrl) {
|
|
@@ -1776,7 +1791,7 @@ __export(build_exports, {
|
|
|
1776
1791
|
async function build(inlineConfig = {}) {
|
|
1777
1792
|
const config = await resolveConfig(inlineConfig, "build");
|
|
1778
1793
|
const startTime = performance.now();
|
|
1779
|
-
console.log(import_picocolors2.default.cyan("\n\u{1F528} nasti build") + import_picocolors2.default.dim(` v${"1.
|
|
1794
|
+
console.log(import_picocolors2.default.cyan("\n\u{1F528} nasti build") + import_picocolors2.default.dim(` v${"1.6.0"}`));
|
|
1780
1795
|
console.log(import_picocolors2.default.dim(` root: ${config.root}`));
|
|
1781
1796
|
console.log(import_picocolors2.default.dim(` mode: ${config.mode}`));
|
|
1782
1797
|
const outDir = import_node_path10.default.resolve(config.root, config.build.outDir);
|
|
@@ -1937,7 +1952,7 @@ async function buildElectron(inlineConfig = {}) {
|
|
|
1937
1952
|
const config = await resolveConfig({ ...inlineConfig, target: "electron" }, "build");
|
|
1938
1953
|
const startTime = performance.now();
|
|
1939
1954
|
assertElectronVersion(config);
|
|
1940
|
-
console.log(import_picocolors3.default.cyan("\n\u26A1 nasti build (electron)") + import_picocolors3.default.dim(` v${"1.
|
|
1955
|
+
console.log(import_picocolors3.default.cyan("\n\u26A1 nasti build (electron)") + import_picocolors3.default.dim(` v${"1.6.0"}`));
|
|
1941
1956
|
console.log(import_picocolors3.default.dim(` root: ${config.root}`));
|
|
1942
1957
|
console.log(import_picocolors3.default.dim(` mode: ${config.mode}`));
|
|
1943
1958
|
console.log(import_picocolors3.default.dim(` target: electron (\u2265 ${config.electron.minVersion})`));
|
|
@@ -2028,7 +2043,7 @@ async function bundleNode(config, entry, opts) {
|
|
|
2028
2043
|
format: opts.format === "cjs" ? "cjs" : "esm",
|
|
2029
2044
|
sourcemap: !!config.build.sourcemap,
|
|
2030
2045
|
minify: !!config.build.minify,
|
|
2031
|
-
|
|
2046
|
+
codeSplitting: false
|
|
2032
2047
|
});
|
|
2033
2048
|
await bundle.close();
|
|
2034
2049
|
console.log(import_picocolors3.default.dim(` \u2713 ${opts.label} \u2192 ${import_node_path11.default.relative(config.root, opts.outFile)}`));
|
|
@@ -2089,7 +2104,7 @@ async function startElectronDev(inlineConfig = {}) {
|
|
|
2089
2104
|
const { noSpawn, ...rest } = inlineConfig;
|
|
2090
2105
|
const config = await resolveConfig({ ...rest, target: "electron" }, "serve");
|
|
2091
2106
|
warnElectronVersion(config);
|
|
2092
|
-
console.log(import_picocolors4.default.cyan("\n\u26A1 nasti electron dev") + import_picocolors4.default.dim(` v${"1.
|
|
2107
|
+
console.log(import_picocolors4.default.cyan("\n\u26A1 nasti electron dev") + import_picocolors4.default.dim(` v${"1.6.0"}`));
|
|
2093
2108
|
const { createServer: createServer2 } = await Promise.resolve().then(() => (init_server(), server_exports));
|
|
2094
2109
|
const server = await createServer2({ ...rest, target: "electron" });
|
|
2095
2110
|
await server.listen();
|
|
@@ -2232,7 +2247,9 @@ async function compileNode(config, entry, opts) {
|
|
|
2232
2247
|
format: opts.format === "cjs" ? "cjs" : "esm",
|
|
2233
2248
|
sourcemap: false,
|
|
2234
2249
|
minify: false,
|
|
2235
|
-
inlineDynamicImports:
|
|
2250
|
+
// rolldown 已弃用 inlineDynamicImports,改用 codeSplitting:false 表达
|
|
2251
|
+
// 同样语义(单 chunk、内联 dynamic import)
|
|
2252
|
+
codeSplitting: false
|
|
2236
2253
|
});
|
|
2237
2254
|
await bundle.close();
|
|
2238
2255
|
}
|
|
@@ -2422,6 +2439,6 @@ cli.command("preview [root]", "Preview production build").option("--port <port>"
|
|
|
2422
2439
|
}
|
|
2423
2440
|
});
|
|
2424
2441
|
cli.help();
|
|
2425
|
-
cli.version("1.
|
|
2442
|
+
cli.version("1.6.0");
|
|
2426
2443
|
cli.parse();
|
|
2427
2444
|
//# sourceMappingURL=cli.cjs.map
|