Skip to content

Commit e1ca288

Browse files
ry-allanzhiqingchen
authored andcommitted
fix(exports): expose web chart builds via browser condition
The package ships web builds (skiaChart.web.js, svgChart.web.js) but the exports for ./skiaChart and ./svgChart only define a default condition pointing at the native build. Subpath exports bypass a bundler's platform-extension resolution, so web bundlers (webpack, Vite, esbuild) resolve the native entry, which pulls in react-native-svg and react-native and fails on web. Add a browser condition to both subpaths so web bundlers resolve the shipped .web.js build. Metro keeps using default for native, so native resolution is unchanged. Signed-off-by: Ryan <4126720+ry-allan@users.noreply.github.com>
1 parent 03704f3 commit e1ca288

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
"./skiaChart": {
1414
"source": "./src/skia/skiaChart.tsx",
1515
"types": "./lib/typescript/src/skia/skiaChart.d.ts",
16+
"browser": "./lib/module/skia/skiaChart.web.js",
1617
"default": "./lib/module/skia/skiaChart.js"
1718
},
1819
"./svgChart": {
1920
"source": "./src/svg/svgChart.tsx",
2021
"types": "./lib/typescript/src/svg/svgChart.d.ts",
22+
"browser": "./lib/module/svg/svgChart.web.js",
2123
"default": "./lib/module/svg/svgChart.js"
2224
},
2325
"./package.json": "./package.json"

0 commit comments

Comments
 (0)