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

fix: Fix broken UMD build #587

Merged
merged 1 commit into from
Aug 22, 2019
Merged

fix: Fix broken UMD build #587

merged 1 commit into from
Aug 22, 2019

Conversation

pimterry
Copy link
Contributor

npm run build is currently broken, for two reasons:

  • browser was removed from package.json recently (d3b30fd), but it's used in rollup.config.js

  • minify && uglify becomes undefined for the non-minified build, which makes rollup-plugin-commonjs throw this (at https://github.com/rollup/rollup-plugin-commonjs/blob/v9.3.4/src/resolve-id.js#L50), because undefined isn't a valid plugin:

    [!] TypeError: Cannot read property 'resolveId' of undefined
    TypeError: Cannot read property 'resolveId' of undefined
        at .../react-sortable-hoc/node_modules/rollup-plugin-commonjs/src/resolve-id.js:52:6
    

    (No idea why this wasn't always happening in the past 🤷‍♂️)

This PR is a quick fix for both. umd:main has the same value browser used to have, so that's easy, and replacing undefined with {} makes plugin.resolveId undefined, which means the plugin gets dropped by rollup, which is really what we want anyway. With this, the build now passes on my machine with a fresh install.

@clauderic
Copy link
Owner

Hey @pimterry, thanks for this PR ❤️

@clauderic clauderic merged commit 6cb7750 into clauderic:master Aug 22, 2019
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

Successfully merging this pull request may close these issues.

2 participants