Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Fix pkg.browser mappings issue by specifying a value of false #183

Merged
merged 2 commits into from Feb 22, 2019

Conversation

allex
Copy link
Contributor

@allex allex commented Oct 18, 2018

Fix pkg.browser with some maps specifying a value of false to ignore a module. (https://github.com/defunctzombie/package-browser-field-spec)

...
"browser": {
    "module-a": false,  // ---->>> map to empty.js
    "./server/only.js": "./shims/server-only.js"
}

@allex allex changed the title Fix pkg.browser mappings issue by specifying a value of false issue. Fix pkg.browser mappings issue by specifying a value of false Oct 18, 2018
src/empty.js Outdated Show resolved Hide resolved
allex added a commit to allex/rollup-plugin-node-resolve that referenced this pull request Oct 18, 2018
allex added a commit to allex/rollup-plugin-node-resolve that referenced this pull request Oct 19, 2018
@bterlson
Copy link
Contributor

@guybedford @TrySound @lukastaegert @keithamus anything I can do to help with this PR? I'm trying to migrate some projects to rollup and being able to ignore node built-ins that I know for sure won't be called in the browser (ala webpack) would be really nice.

In the meantime, I'm rolling my own shims with rollup-plugin-shim, but it's frustrating because I have to shim each export which I think this PR obviates. Let me know if there's a better workaround!

@lukastaegert
Copy link
Member

Will try to have a look tomorrow

@bterlson
Copy link
Contributor

@lukastaegert yay! I'm here all day (PST), let me know if I can help!

allex added a commit to allex/rollup-plugin-node-resolve that referenced this pull request Feb 20, 2019
Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from the two remaining suggestions

src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
@lukastaegert lukastaegert merged commit 9ce01d4 into rollup:master Feb 22, 2019
@lukastaegert
Copy link
Member

Released

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

Successfully merging this pull request may close these issues.

None yet

4 participants