@package-broker/adapter-node 0.3.0 → 0.3.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/package.json +1 -1
- package/tsup.config.ts +19 -0
package/package.json
CHANGED
package/tsup.config.ts
CHANGED
|
@@ -10,11 +10,30 @@ const cloudflarePlugin = {
|
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
// Node.js built-in modules that should not be bundled
|
|
14
|
+
const nodeBuiltins = [
|
|
15
|
+
'util', 'path', 'fs', 'os', 'crypto', 'stream', 'events', 'buffer',
|
|
16
|
+
'url', 'querystring', 'http', 'https', 'net', 'tls', 'dns', 'zlib',
|
|
17
|
+
'child_process', 'cluster', 'module', 'process', 'assert', 'string_decoder',
|
|
18
|
+
'timers', 'punycode', 'readline', 'repl', 'tty', 'vm', 'worker_threads'
|
|
19
|
+
];
|
|
20
|
+
|
|
13
21
|
export default defineConfig({
|
|
14
22
|
entry: ['src/index.ts'],
|
|
15
23
|
format: ['esm'],
|
|
16
24
|
target: 'node20',
|
|
17
25
|
noExternal: ['@package-broker/core', '@package-broker/shared'],
|
|
26
|
+
external: nodeBuiltins,
|
|
18
27
|
clean: true,
|
|
19
28
|
esbuildPlugins: [cloudflarePlugin],
|
|
29
|
+
banner: {
|
|
30
|
+
js: `
|
|
31
|
+
import { createRequire } from 'module';
|
|
32
|
+
import { fileURLToPath } from 'url';
|
|
33
|
+
import { dirname } from 'path';
|
|
34
|
+
const require = createRequire(import.meta.url);
|
|
35
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
36
|
+
const __dirname = dirname(__filename);
|
|
37
|
+
`.trim(),
|
|
38
|
+
},
|
|
20
39
|
});
|