@cedarjs/vite 5.0.0-canary.2464 → 5.0.0-canary.2465

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.
@@ -183,7 +183,22 @@ async function bundleDistFile(distPath) {
183
183
  format: "esm",
184
184
  platform: "node",
185
185
  target: "node24",
186
- packages: "external",
186
+ plugins: [
187
+ {
188
+ name: "ud-external",
189
+ setup(build2) {
190
+ build2.onResolve({ filter: /^[^.]/ }, (args) => {
191
+ if (args.path.startsWith("/")) {
192
+ return;
193
+ }
194
+ if (args.path.startsWith("api/")) {
195
+ return;
196
+ }
197
+ return { external: true };
198
+ });
199
+ }
200
+ }
201
+ ],
187
202
  logLevel: "silent"
188
203
  });
189
204
  let text = result.outputFiles[0].text;
@@ -204,12 +219,16 @@ const __cedar_default = ${defaultBinding};`;
204
219
  }
205
220
  async function generateGraphQLModule(distPath) {
206
221
  const bundledCode = await bundleDistFile(distPath);
222
+ const cleanedCode = bundledCode.replace(
223
+ /\n\s*(?:var|const)\s+\w+\s*=\s*createGraphQLHandler\s*\(.*\)\s*;?/,
224
+ "\n"
225
+ );
207
226
  return `
208
227
  import { buildCedarContext, requestToLegacyEvent } from '@cedarjs/api/runtime';
209
228
  import { createGraphQLYoga } from '@cedarjs/graphql-server';
210
229
 
211
230
  // Inlined bundle of ${import_node_path.default.basename(distPath)} (node_modules kept external)
212
- ${bundledCode}
231
+ ${cleanedCode}
213
232
 
214
233
  let yogaInitPromise = null;
215
234
 
@@ -150,7 +150,22 @@ async function bundleDistFile(distPath) {
150
150
  format: "esm",
151
151
  platform: "node",
152
152
  target: "node24",
153
- packages: "external",
153
+ plugins: [
154
+ {
155
+ name: "ud-external",
156
+ setup(build2) {
157
+ build2.onResolve({ filter: /^[^.]/ }, (args) => {
158
+ if (args.path.startsWith("/")) {
159
+ return;
160
+ }
161
+ if (args.path.startsWith("api/")) {
162
+ return;
163
+ }
164
+ return { external: true };
165
+ });
166
+ }
167
+ }
168
+ ],
154
169
  logLevel: "silent"
155
170
  });
156
171
  let text = result.outputFiles[0].text;
@@ -171,12 +186,16 @@ const __cedar_default = ${defaultBinding};`;
171
186
  }
172
187
  async function generateGraphQLModule(distPath) {
173
188
  const bundledCode = await bundleDistFile(distPath);
189
+ const cleanedCode = bundledCode.replace(
190
+ /\n\s*(?:var|const)\s+\w+\s*=\s*createGraphQLHandler\s*\(.*\)\s*;?/,
191
+ "\n"
192
+ );
174
193
  return `
175
194
  import { buildCedarContext, requestToLegacyEvent } from '@cedarjs/api/runtime';
176
195
  import { createGraphQLYoga } from '@cedarjs/graphql-server';
177
196
 
178
197
  // Inlined bundle of ${path.basename(distPath)} (node_modules kept external)
179
- ${bundledCode}
198
+ ${cleanedCode}
180
199
 
181
200
  let yogaInitPromise = null;
182
201
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/vite",
3
- "version": "5.0.0-canary.2464",
3
+ "version": "5.0.0-canary.2465",
4
4
  "description": "Vite configuration package for CedarJS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -69,17 +69,17 @@
69
69
  "@babel/generator": "7.29.1",
70
70
  "@babel/parser": "7.29.3",
71
71
  "@babel/traverse": "7.29.0",
72
- "@cedarjs/api": "5.0.0-canary.2464",
73
- "@cedarjs/auth": "5.0.0-canary.2464",
74
- "@cedarjs/babel-config": "5.0.0-canary.2464",
75
- "@cedarjs/context": "5.0.0-canary.2464",
76
- "@cedarjs/cookie-jar": "5.0.0-canary.2464",
77
- "@cedarjs/graphql-server": "5.0.0-canary.2464",
78
- "@cedarjs/internal": "5.0.0-canary.2464",
79
- "@cedarjs/project-config": "5.0.0-canary.2464",
80
- "@cedarjs/server-store": "5.0.0-canary.2464",
81
- "@cedarjs/testing": "5.0.0-canary.2464",
82
- "@cedarjs/web": "5.0.0-canary.2464",
72
+ "@cedarjs/api": "5.0.0-canary.2465",
73
+ "@cedarjs/auth": "5.0.0-canary.2465",
74
+ "@cedarjs/babel-config": "5.0.0-canary.2465",
75
+ "@cedarjs/context": "5.0.0-canary.2465",
76
+ "@cedarjs/cookie-jar": "5.0.0-canary.2465",
77
+ "@cedarjs/graphql-server": "5.0.0-canary.2465",
78
+ "@cedarjs/internal": "5.0.0-canary.2465",
79
+ "@cedarjs/project-config": "5.0.0-canary.2465",
80
+ "@cedarjs/server-store": "5.0.0-canary.2465",
81
+ "@cedarjs/testing": "5.0.0-canary.2465",
82
+ "@cedarjs/web": "5.0.0-canary.2465",
83
83
  "@fastify/url-data": "6.0.3",
84
84
  "@swc/core": "1.15.33",
85
85
  "@universal-deploy/store": "^0.2.1",