@zappdev/vite 0.5.0-alpha.2 → 0.5.0-alpha.4
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 +1 -11
- package/package.json +5 -4
- package/src/index.ts +1 -15
package/dist/index.js
CHANGED
|
@@ -85,7 +85,7 @@ function zappWorkers(options) {
|
|
|
85
85
|
return {
|
|
86
86
|
name: "zapp-workers",
|
|
87
87
|
enforce: "pre",
|
|
88
|
-
|
|
88
|
+
configResolved(config) {
|
|
89
89
|
root = config.root;
|
|
90
90
|
srcDir = path.join(root, "src");
|
|
91
91
|
outDir = path.join(root, "dist", "_workers");
|
|
@@ -94,16 +94,6 @@ function zappWorkers(options) {
|
|
|
94
94
|
if (resolvedAlias && typeof resolvedAlias === "object" && !Array.isArray(resolvedAlias)) {
|
|
95
95
|
aliases = resolvedAlias;
|
|
96
96
|
}
|
|
97
|
-
if (!backendFromConfig) {
|
|
98
|
-
try {
|
|
99
|
-
const configPath = path.join(root, "zapp.config.ts");
|
|
100
|
-
const mod = await import(configPath);
|
|
101
|
-
const zappConfig = typeof mod.default === "function" ? mod.default() : mod.default;
|
|
102
|
-
if (zappConfig?.backend) {
|
|
103
|
-
backendFromConfig = zappConfig.backend;
|
|
104
|
-
}
|
|
105
|
-
} catch {}
|
|
106
|
-
}
|
|
107
97
|
},
|
|
108
98
|
async buildStart() {
|
|
109
99
|
workers = await discoverWorkers(srcDir);
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zappdev/vite",
|
|
3
|
-
"version": "0.5.0-alpha.
|
|
3
|
+
"version": "0.5.0-alpha.4",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "src/index.ts",
|
|
7
5
|
"exports": {
|
|
8
|
-
".":
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
|
+
}
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
11
12
|
"dist/",
|
package/src/index.ts
CHANGED
|
@@ -123,7 +123,7 @@ export function zappWorkers(options?: ZappWorkersOptions): Plugin {
|
|
|
123
123
|
name: "zapp-workers",
|
|
124
124
|
enforce: "pre",
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
configResolved(config) {
|
|
127
127
|
root = config.root;
|
|
128
128
|
srcDir = path.join(root, "src");
|
|
129
129
|
outDir = path.join(root, "dist", "_workers");
|
|
@@ -134,20 +134,6 @@ export function zappWorkers(options?: ZappWorkersOptions): Plugin {
|
|
|
134
134
|
if (resolvedAlias && typeof resolvedAlias === "object" && !Array.isArray(resolvedAlias)) {
|
|
135
135
|
aliases = resolvedAlias as Record<string, string>;
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
// Auto-read backend path from zapp.config.ts if not passed as option
|
|
139
|
-
if (!backendFromConfig) {
|
|
140
|
-
try {
|
|
141
|
-
const configPath = path.join(root, "zapp.config.ts");
|
|
142
|
-
const mod = await import(configPath);
|
|
143
|
-
const zappConfig = typeof mod.default === "function" ? mod.default() : mod.default;
|
|
144
|
-
if (zappConfig?.backend) {
|
|
145
|
-
backendFromConfig = zappConfig.backend;
|
|
146
|
-
}
|
|
147
|
-
} catch {
|
|
148
|
-
// No zapp.config.ts or no backend field — that's fine
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
137
|
},
|
|
152
138
|
|
|
153
139
|
async buildStart() {
|