@nasti-toolchain/nasti 1.5.2 → 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 +21 -12
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +21 -12
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +21 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -793,7 +793,7 @@ import pc from "picocolors";
|
|
|
793
793
|
async function build(inlineConfig = {}) {
|
|
794
794
|
const config = await resolveConfig(inlineConfig, "build");
|
|
795
795
|
const startTime = performance.now();
|
|
796
|
-
console.log(pc.cyan("\n\u{1F528} nasti build") + pc.dim(` v${"1.
|
|
796
|
+
console.log(pc.cyan("\n\u{1F528} nasti build") + pc.dim(` v${"1.6.0"}`));
|
|
797
797
|
console.log(pc.dim(` root: ${config.root}`));
|
|
798
798
|
console.log(pc.dim(` mode: ${config.mode}`));
|
|
799
799
|
const outDir = path7.resolve(config.root, config.build.outDir);
|
|
@@ -1764,12 +1764,19 @@ async function createServer(inlineConfig = {}) {
|
|
|
1764
1764
|
app.use(sirv(config.root, { dev: true, etag: true }));
|
|
1765
1765
|
const httpServer = http.createServer(app);
|
|
1766
1766
|
const ws = createWebSocketServer(httpServer);
|
|
1767
|
+
const ignoredSegments = /* @__PURE__ */ new Set(["node_modules", ".git", ".nasti"]);
|
|
1768
|
+
const outDirAbs = path11.resolve(config.root, config.build.outDir);
|
|
1767
1769
|
const watcher = watch(config.root, {
|
|
1768
|
-
ignored:
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1770
|
+
ignored: (filePath) => {
|
|
1771
|
+
if (filePath === config.root) return false;
|
|
1772
|
+
if (filePath === outDirAbs || filePath.startsWith(outDirAbs + path11.sep)) return true;
|
|
1773
|
+
const rel = path11.relative(config.root, filePath);
|
|
1774
|
+
if (!rel || rel.startsWith("..") || path11.isAbsolute(rel)) return false;
|
|
1775
|
+
for (const seg of rel.split(path11.sep)) {
|
|
1776
|
+
if (ignoredSegments.has(seg)) return true;
|
|
1777
|
+
}
|
|
1778
|
+
return false;
|
|
1779
|
+
},
|
|
1773
1780
|
ignoreInitial: true
|
|
1774
1781
|
});
|
|
1775
1782
|
let server;
|
|
@@ -1797,7 +1804,7 @@ async function createServer(inlineConfig = {}) {
|
|
|
1797
1804
|
const localUrl = `http://localhost:${actualPort}`;
|
|
1798
1805
|
const networkUrl = host === "0.0.0.0" ? `http://${getNetworkAddress()}:${actualPort}` : null;
|
|
1799
1806
|
console.log();
|
|
1800
|
-
console.log(pc3.cyan(" nasti dev server") + pc3.dim(` v${"1.
|
|
1807
|
+
console.log(pc3.cyan(" nasti dev server") + pc3.dim(` v${"1.6.0"}`));
|
|
1801
1808
|
console.log();
|
|
1802
1809
|
console.log(` ${pc3.green(">")} Local: ${pc3.cyan(localUrl)}`);
|
|
1803
1810
|
if (networkUrl) {
|
|
@@ -1921,7 +1928,7 @@ async function buildElectron(inlineConfig = {}) {
|
|
|
1921
1928
|
const config = await resolveConfig({ ...inlineConfig, target: "electron" }, "build");
|
|
1922
1929
|
const startTime = performance.now();
|
|
1923
1930
|
assertElectronVersion(config);
|
|
1924
|
-
console.log(pc2.cyan("\n\u26A1 nasti build (electron)") + pc2.dim(` v${"1.
|
|
1931
|
+
console.log(pc2.cyan("\n\u26A1 nasti build (electron)") + pc2.dim(` v${"1.6.0"}`));
|
|
1925
1932
|
console.log(pc2.dim(` root: ${config.root}`));
|
|
1926
1933
|
console.log(pc2.dim(` mode: ${config.mode}`));
|
|
1927
1934
|
console.log(pc2.dim(` target: electron (\u2265 ${config.electron.minVersion})`));
|
|
@@ -2012,7 +2019,7 @@ async function bundleNode(config, entry, opts) {
|
|
|
2012
2019
|
format: opts.format === "cjs" ? "cjs" : "esm",
|
|
2013
2020
|
sourcemap: !!config.build.sourcemap,
|
|
2014
2021
|
minify: !!config.build.minify,
|
|
2015
|
-
|
|
2022
|
+
codeSplitting: false
|
|
2016
2023
|
});
|
|
2017
2024
|
await bundle.close();
|
|
2018
2025
|
console.log(pc2.dim(` \u2713 ${opts.label} \u2192 ${path8.relative(config.root, opts.outFile)}`));
|
|
@@ -2068,7 +2075,7 @@ async function startElectronDev(inlineConfig = {}) {
|
|
|
2068
2075
|
const { noSpawn, ...rest } = inlineConfig;
|
|
2069
2076
|
const config = await resolveConfig({ ...rest, target: "electron" }, "serve");
|
|
2070
2077
|
warnElectronVersion(config);
|
|
2071
|
-
console.log(pc4.cyan("\n\u26A1 nasti electron dev") + pc4.dim(` v${"1.
|
|
2078
|
+
console.log(pc4.cyan("\n\u26A1 nasti electron dev") + pc4.dim(` v${"1.6.0"}`));
|
|
2072
2079
|
const { createServer: createServer2 } = await Promise.resolve().then(() => (init_server(), server_exports));
|
|
2073
2080
|
const server = await createServer2({ ...rest, target: "electron" });
|
|
2074
2081
|
await server.listen();
|
|
@@ -2211,7 +2218,9 @@ async function compileNode(config, entry, opts) {
|
|
|
2211
2218
|
format: opts.format === "cjs" ? "cjs" : "esm",
|
|
2212
2219
|
sourcemap: false,
|
|
2213
2220
|
minify: false,
|
|
2214
|
-
inlineDynamicImports:
|
|
2221
|
+
// rolldown 已弃用 inlineDynamicImports,改用 codeSplitting:false 表达
|
|
2222
|
+
// 同样语义(单 chunk、内联 dynamic import)
|
|
2223
|
+
codeSplitting: false
|
|
2215
2224
|
});
|
|
2216
2225
|
await bundle.close();
|
|
2217
2226
|
}
|
|
@@ -2317,7 +2326,7 @@ function monacoEditorPlugin(options = {}) {
|
|
|
2317
2326
|
format: "iife",
|
|
2318
2327
|
sourcemap: false,
|
|
2319
2328
|
minify: true,
|
|
2320
|
-
|
|
2329
|
+
codeSplitting: false
|
|
2321
2330
|
});
|
|
2322
2331
|
await bundle.close();
|
|
2323
2332
|
return cacheFile;
|