@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.
Files changed (2) hide show
  1. package/dist/index.js +9 -6
  2. 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
- return {
2223
- publicDir: options.publicDir ?? cloudwerkConfig.publicDir ?? "public"
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudwerk/vite-plugin",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Vite plugin for Cloudwerk file-based routing with virtual entry generation",
5
5
  "repository": {
6
6
  "type": "git",