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鈥檒l 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

Conversation

@pimterry
Copy link
Contributor

commented Aug 22, 2019

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

This comment has been minimized.

Copy link
Owner

commented Aug 22, 2019

Hey @pimterry, thanks for this PR 鉂わ笍

@clauderic clauderic merged commit 6cb7750 into clauderic:master Aug 22, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.