xanix 1.0.4 → 1.0.5
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.
|
@@ -42,13 +42,14 @@ const BuildServer = async ({ rootEntry, onBuildEnd }) => {
|
|
|
42
42
|
if (id.startsWith(".") ||
|
|
43
43
|
path.isAbsolute(id) ||
|
|
44
44
|
id === "@" ||
|
|
45
|
-
id.startsWith("@/")
|
|
45
|
+
id.startsWith("@/") ||
|
|
46
|
+
id.startsWith("xanix")) {
|
|
46
47
|
return false;
|
|
47
48
|
}
|
|
48
49
|
return true;
|
|
49
50
|
},
|
|
50
51
|
});
|
|
51
|
-
await build.write(bundlerOutput.server());
|
|
52
|
+
await build.write(bundlerOutput.server({ isDev: false }));
|
|
52
53
|
await build.close();
|
|
53
54
|
await onBuildEnd(entries);
|
|
54
55
|
};
|
|
@@ -31,11 +31,11 @@ const client = (entries, { isDev }) => {
|
|
|
31
31
|
}
|
|
32
32
|
return opt;
|
|
33
33
|
};
|
|
34
|
-
const server = () => {
|
|
34
|
+
const server = (opt) => {
|
|
35
35
|
return {
|
|
36
36
|
dir: outDir.server,
|
|
37
37
|
format: "esm",
|
|
38
|
-
sourcemap:
|
|
38
|
+
sourcemap: opt.isDev ?? true,
|
|
39
39
|
entryFileNames: "[name].js",
|
|
40
40
|
chunkFileNames: "chunks/[hash].js",
|
|
41
41
|
assetFileNames: "assets/[hash][extname]",
|
|
@@ -31,19 +31,23 @@ const watchServer = async ({ rootEntry, onChange, onBuildEnd, onServerChange, on
|
|
|
31
31
|
target: "server",
|
|
32
32
|
development: true,
|
|
33
33
|
assetExternal: false,
|
|
34
|
-
onChange:
|
|
34
|
+
onChange: (entry) => {
|
|
35
|
+
changedFiles.add(entry);
|
|
36
|
+
return onChange?.(entry);
|
|
37
|
+
},
|
|
35
38
|
}),
|
|
36
39
|
],
|
|
37
40
|
external(id) {
|
|
38
41
|
if (id.startsWith(".") ||
|
|
39
42
|
path.isAbsolute(id) ||
|
|
40
43
|
id === "@" ||
|
|
41
|
-
id.startsWith("@/")
|
|
44
|
+
id.startsWith("@/") ||
|
|
45
|
+
id.startsWith("xanix")) {
|
|
42
46
|
return false;
|
|
43
47
|
}
|
|
44
48
|
return true;
|
|
45
49
|
},
|
|
46
|
-
output: bundlerOutput.server(),
|
|
50
|
+
output: bundlerOutput.server({ isDev: true }),
|
|
47
51
|
watch: {
|
|
48
52
|
clearScreen: false,
|
|
49
53
|
},
|
package/dist/bin/cli/dev.js
CHANGED
|
@@ -11,7 +11,7 @@ const root = process.cwd();
|
|
|
11
11
|
let child;
|
|
12
12
|
function start() {
|
|
13
13
|
child?.kill();
|
|
14
|
-
return new Promise((resolve
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
15
|
const filePath = path.join(outDir.server, "index.js");
|
|
16
16
|
child = spawn(process.execPath, [filePath], {
|
|
17
17
|
stdio: !child ? "inherit" : "pipe",
|
|
@@ -78,7 +78,7 @@ const dev = async (rootEntry) => {
|
|
|
78
78
|
async onClientEntryChange(_entry, entries) {
|
|
79
79
|
await clientWatcher(entries);
|
|
80
80
|
},
|
|
81
|
-
onServerChange: async (
|
|
81
|
+
onServerChange: async (_entry, _entries) => {
|
|
82
82
|
await start();
|
|
83
83
|
},
|
|
84
84
|
onBuildEnd: async () => {
|