@useavalon/avalon 0.1.10 → 0.1.11
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/package.json +1 -1
- package/src/vite-plugin/plugin.ts +14 -6
package/package.json
CHANGED
|
@@ -282,13 +282,21 @@ export async function avalon(config?: AvalonPluginConfig): Promise<PluginOption[
|
|
|
282
282
|
enforce: "pre",
|
|
283
283
|
|
|
284
284
|
config() {
|
|
285
|
-
// @useavalon packages ship raw .ts source for SSR
|
|
286
|
-
//
|
|
287
|
-
//
|
|
288
|
-
//
|
|
289
|
-
//
|
|
290
|
-
//
|
|
285
|
+
// @useavalon packages ship raw .ts source for SSR and pre-compiled
|
|
286
|
+
// .js for client-side code.
|
|
287
|
+
//
|
|
288
|
+
// oxc.exclude: Prevents Vite's built-in OXC from processing @useavalon
|
|
289
|
+
// .ts files. Without this, OXC applies integration plugins' global
|
|
290
|
+
// jsx: 'automatic' config to plain .ts files, causing errors.
|
|
291
|
+
// Our transform hook below handles TS stripping for SSR instead.
|
|
292
|
+
// Client-side loads .js files which OXC skips by default (/\.js$/).
|
|
293
|
+
//
|
|
294
|
+
// ssr.noExternal: Ensures Vite processes @useavalon packages through
|
|
295
|
+
// the SSR transform pipeline instead of treating them as external CJS.
|
|
291
296
|
return {
|
|
297
|
+
oxc: {
|
|
298
|
+
exclude: [/node_modules\/@useavalon\/.*\.tsx?$/],
|
|
299
|
+
},
|
|
292
300
|
ssr: {
|
|
293
301
|
noExternal: [/^@useavalon\//],
|
|
294
302
|
},
|