Skip to content

Commit c1b0ea2

Browse files
committed
fix: prevent node:module imports in browser bundles
Change build target from 'node' to 'browser' to ensure browser-compatible output without Node.js-specific module imports. This fixes unintended node-specific code from entering the bundle.
1 parent 502fe14 commit c1b0ea2

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.changeset/soft-eels-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"markdown-to-jsx": patch
3+
---
4+
5+
Fix unintended node-specific code from entering browser bundles by changing build target from 'node' to 'browser'

bunup.config.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,19 @@ export default defineConfig([
1717
{
1818
...common,
1919
name: 'main',
20-
entry: ['src/index.tsx', 'src/react.tsx', 'src/html.ts', 'src/markdown.ts', 'src/native.tsx', 'src/solid.tsx', 'src/vue.tsx'],
20+
entry: [
21+
'src/index.tsx',
22+
'src/react.tsx',
23+
'src/html.ts',
24+
'src/markdown.ts',
25+
'src/native.tsx',
26+
'src/solid.tsx',
27+
'src/vue.tsx',
28+
],
2129
outDir: 'dist',
2230
format: ['esm', 'cjs'],
2331
dts: true,
2432
external: ['react', 'react-native', 'solid-js', 'vue'],
25-
target: 'node',
33+
target: 'browser',
2634
},
2735
])

docs/sitemap.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://markdown-to-jsx.quantizor.dev/</loc>
5-
<lastmod>2025-11-30</lastmod>
5+
<lastmod>2025-12-06</lastmod>
66
<changefreq>weekly</changefreq>
77
<priority>1.0</priority>
88
</url>
99
<url>
1010
<loc>https://markdown-to-jsx.quantizor.dev/llms.txt</loc>
11-
<lastmod>2025-11-30</lastmod>
11+
<lastmod>2025-12-06</lastmod>
1212
<changefreq>weekly</changefreq>
1313
<priority>0.8</priority>
1414
</url>

0 commit comments

Comments
 (0)