-
-
Notifications
You must be signed in to change notification settings - Fork 834
bug: Does not import browser field from package.json #6335
Copy link
Copy link
Closed
Labels
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.35.3
Current Behavior
When building with dist output, the built web component of stencil includes the server side code. In this case this is teh qrcode package, which has a package.json as follow:
"main": "./lib/index.js",
"browser": {
"./lib/index.js": "./lib/browser.js",
"fs": false
},However, when building stencil components, we need to have the browser code (lib/browser.js) imported and not the server code.
what should be the stencil.config.ts correct configuration to make this happen?
Expected Behavior
import browser side code
System Info
System: node 22.16.0
Platform: darwin (24.5.0)
CPU Model: Apple M4 Max (16 cpus)
Compiler: node_modules/@stencil/core/compiler/stencil.js
Build: 1751490465
Stencil: 4.35.3 🎹
TypeScript: 5.5.4
Rollup: 4.34.9
Parse5: 7.2.1
jQuery: 4.0.0-pre
Terser: 5.37.0Steps to Reproduce
use the qrcode package as an example and try to bundle into a component.
Code Reproduction URL
n/a ATM
Additional Information
No response
Reactions are currently unavailable