Skip to content
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

Use "browser" tag in package.json #1426

Closed
ryanlsimms opened this issue Dec 9, 2021 · 2 comments
Closed

Use "browser" tag in package.json #1426

ryanlsimms opened this issue Dec 9, 2021 · 2 comments

Comments

@ryanlsimms
Copy link

Bootstrap imports popper using import * as Popper from '@popperjs/core', which will aways import the cjs version, even if the distribution is intended for browser. This fails in my semi-buildless workflow when importing bootstrap using rollupjs.

Some of workarounds given in #933 work, but I think the best solution would be to use the "browser" field in package.json as intended and point it to the umd (or esm?) distribution.

"main": "dist/cjs/popper.js",
"main:umd": "dist/umd/popper.js",
"module": "lib/index.js",
"unpkg": "dist/umd/popper.min.js",
"browser": "dist/umd/popper.js",
@TrySound
Copy link

TrySound commented Dec 9, 2021

browser is not supposed to be umd. It can be a map to specify which files need to be aliased to make package work in browser. There is no need for it in this project.

See example
https://github.com/visgl/react-map-gl/blob/e4b44c3feda3458c2a1ea6f0e8ede8ffd01188c2/package.json#L21-L26

@atomiks
Copy link
Collaborator

atomiks commented Jan 15, 2022

At this point in time we are not updating Popper's build setup. For Floating UI we're working on low/no build compatibility here #1502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants