@xyd-js/sources 0.0.1-xyd.0

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/tsup.config.ts ADDED
@@ -0,0 +1,39 @@
1
+ import {defineConfig, Options} from 'tsup';
2
+
3
+ const config: Options = {
4
+ entry: {
5
+ index: 'src/index.ts',
6
+ example: 'test-cmd/index.ts'
7
+
8
+ },
9
+ format: ['esm', 'cjs'], // Output both ESM and CJS formats
10
+ target: 'node16', // Ensure compatibility with Node.js 16
11
+ dts: {
12
+ entry: {
13
+ index: 'src/index.ts',
14
+ example: 'test-cmd/index.ts'
15
+
16
+ },
17
+ resolve: true, // Resolve external types
18
+ },
19
+ splitting: false, // Disable code splitting
20
+ sourcemap: true, // Generate source maps
21
+ clean: true, // Clean the output directory before each build
22
+ esbuildOptions: (options) => {
23
+ options.platform = 'node'; // Ensure the platform is set to Node.js
24
+ options.external = [
25
+ 'react',
26
+ 'fs',
27
+ 'path',
28
+ 'node:fs',
29
+ 'node:fs/promises',
30
+ 'typescript', // Mark typescript as external
31
+ 'codehike',
32
+ 'unist-util-visit',
33
+ '@mdx-js/mdx'
34
+ ]; // Mark these modules as external
35
+ options.loader = { '.js': 'jsx' }; // Ensure proper handling of .js files
36
+ },
37
+ }
38
+
39
+ export default defineConfig(config);