@quilted/rollup 0.2.12 → 0.2.14

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.
@@ -1,34 +0,0 @@
1
- import {MAGIC_MODULE_ENTRY, MAGIC_MODULE_REQUEST_ROUTER} from '../constants.ts';
2
-
3
- import {createMagicModulePlugin} from '../shared/magic-module.ts';
4
- import {multiline} from '../shared/strings.ts';
5
-
6
- export function magicModuleRequestRouterEntry({
7
- host,
8
- port,
9
- }: {
10
- host?: string;
11
- port?: number;
12
- } = {}) {
13
- return createMagicModulePlugin({
14
- name: '@quilted/request-router',
15
- sideEffects: true,
16
- module: MAGIC_MODULE_ENTRY,
17
- async source() {
18
- const initialContent = multiline`
19
- import requestRouter from ${JSON.stringify(
20
- MAGIC_MODULE_REQUEST_ROUTER,
21
- )};
22
-
23
- import {createHttpServer} from '@quilted/quilt/request-router/node';
24
-
25
- const port = ${port ?? 'Number.parseInt(process.env.PORT, 10)'};
26
- const host = ${host ? JSON.stringify(host) : 'process.env.HOST'};
27
-
28
- createHttpServer(requestRouter).listen(port, host);
29
- `;
30
-
31
- return initialContent;
32
- },
33
- });
34
- }