@cloudwerk/vite-plugin 0.6.6 → 0.6.7
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 +9 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2214,14 +2214,17 @@ function cloudwerkPlugin(options = {}) {
|
|
|
2214
2214
|
* This enables Vite's built-in static file serving for the public directory.
|
|
2215
2215
|
*/
|
|
2216
2216
|
async config(userConfig) {
|
|
2217
|
-
if (userConfig.publicDir !== void 0) {
|
|
2218
|
-
return {};
|
|
2219
|
-
}
|
|
2220
2217
|
const root = userConfig.root ?? process.cwd();
|
|
2221
2218
|
const cloudwerkConfig = await loadConfig(root);
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2219
|
+
const renderer = options.renderer ?? cloudwerkConfig.ui?.renderer ?? "hono-jsx";
|
|
2220
|
+
const config = {};
|
|
2221
|
+
if (renderer === "react") {
|
|
2222
|
+
config.esbuild = { jsxImportSource: "react" };
|
|
2223
|
+
}
|
|
2224
|
+
if (userConfig.publicDir === void 0) {
|
|
2225
|
+
config.publicDir = options.publicDir ?? cloudwerkConfig.publicDir ?? "public";
|
|
2226
|
+
}
|
|
2227
|
+
return config;
|
|
2225
2228
|
},
|
|
2226
2229
|
/**
|
|
2227
2230
|
* Resolve configuration and build initial manifest.
|