-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopt browser field in package.json ala browserify #200
Comments
We use browser-resolve which is the same module browserify uses for resolving so it should already work. Is it not for you? |
OMG, it does! I had the wrong paths DOH. So sorry for the noise! |
Some bundlers including Browserify[1] and Parcel[2] use the browser field in package.json to ignore modules (using browser-resolve[3]) that do not work well with browsers. In our case this is the zuliprc related module, fs-readfile-promise. This commit adds a browser field with fs-readfile-promise set to false to the package.json, so that clients that are bundled with Browserify or Parcel can use zulip-js out of the box. 1: https://github.com/browserify/browserify-handbook#browser-field 2: parcel-bundler/parcel#200 3: https://github.com/defunctzombie/node-browser-resolve
Some bundlers including Browserify[1] and Parcel[2] use the browser field in package.json to ignore modules (using browser-resolve[3]) that do not work well with browsers. In our case this is the zuliprc related module, fs-readfile-promise. This commit adds a browser field with fs-readfile-promise set to false to the package.json, so that clients that are bundled with Browserify or Parcel can use zulip-js out of the box. 1: https://github.com/browserify/browserify-handbook#browser-field 2: parcel-bundler/parcel#200 3: https://github.com/defunctzombie/node-browser-resolve
I think I might be having a problem with this feature. I get the following error when trying to run a browser app that depends on Webtorrent.
Webtorrent includes the node The package.json file appears to properly set For some reason it tries to compile in the tcp-pool.js file even though it shouldn't if the import is set to Does parcel support using |
@devongovett it appears that Parcel is no longer using browser-resolve? I am still experiencing this bug - on Windows. I have a repo demonstrating the bug. |
🙋 feature request
Adopt
browser
field inpackage.json
ala browserify🎛 Configuration
package.json
Per https://github.com/browserify/browserify-handbook#browser-field
🤔 Expected Behavior
Clone the browserify feature precisely. This will make SSR much easier to do.
💚 Current Behavior
Current behavior defaults to assuming everything is being bundled for the browser only; allowing devs to opt into specific file cases makes it easier to support prerendering content for the browser.
The text was updated successfully, but these errors were encountered: