svelte-adapter-uws 0.2.2 → 0.2.3
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/index.js +15 -18
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -87,24 +87,21 @@ export default function (opts = {}) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (handlerFile) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
`export * from '${handlerPath}';\n`
|
|
106
|
-
);
|
|
107
|
-
}
|
|
90
|
+
// Bundle through esbuild to resolve SvelteKit aliases ($lib etc.)
|
|
91
|
+
// and handle TypeScript. Without this, $lib imports survive into
|
|
92
|
+
// the Rollup step which doesn't know about SvelteKit aliases.
|
|
93
|
+
const esbuild = await import('esbuild');
|
|
94
|
+
const libDir = path.resolve(builder.config.kit.files?.lib || 'src/lib');
|
|
95
|
+
|
|
96
|
+
await esbuild.build({
|
|
97
|
+
entryPoints: [path.resolve(handlerFile)],
|
|
98
|
+
bundle: true,
|
|
99
|
+
format: 'esm',
|
|
100
|
+
platform: 'node',
|
|
101
|
+
outfile: `${tmp}/ws-handler.js`,
|
|
102
|
+
alias: { '$lib': libDir },
|
|
103
|
+
packages: 'external'
|
|
104
|
+
});
|
|
108
105
|
builder.log.minor(`WebSocket handler: ${handlerFile}`);
|
|
109
106
|
} else {
|
|
110
107
|
// No handler found - use built-in default (subscribe/unsubscribe only)
|
package/package.json
CHANGED