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

Version in dist/ (used by bower and npmcdn) is out of date #111

Closed
joepvl opened this issue Jun 24, 2016 · 1 comment
Closed

Version in dist/ (used by bower and npmcdn) is out of date #111

joepvl opened this issue Jun 24, 2016 · 1 comment

Comments

@joepvl
Copy link
Collaborator

joepvl commented Jun 24, 2016

See title, I ran into this issue when trying to use v0.6.1 on jsbin through npmcdn.

TL;DR it looks like npm run bundle is bundling outdated files in lib/ to umd in dist/ during "preversion"; need to make sure npm run build is run before npm run bundle.


Before I go any further I just want to clarify that technically there's a difference between what's used by bower and npmcdn; bower uses the dist/ dir in the repo, which doesn't need to be there for npmcdn - instead, for npmcdn the files array in package.json can be used without actually including dist/ in the repo (just need to make sure it's there when you npm publish, which you can do using the "prebublish" script). That said, apparently this package still supports bower (at least for now), so it needs dist/ in the repo as well as on npm.

Anway, as far as I can tell this issue happens because the build:umd and build:umd:min commands depend on lib/ containing the right files to build into umd and minify. However, the "preversion" script (used to update dist/ in the repo when running npm version) doesn't include npm run build (which updates lib/ with the commonjs build), and the "prepublish" script doesn't include npm run bundle. So basically dist/ never gets updated unless you run the extra scripts manually 😭 .

One solution would be to change "preversion" to include npm run build before npm run bundle. That way, lib/ will be updated with the commonjs build before building to dist/, and you'll be able to get the latest build from both bower and npmcdn after git push and npm publish respectively.

When the time comes to drop bower support, you'd git rm dist/, add dist/ to .gitignore, add dist/ to the "clean" script, add npm run bundle to the end of "prepublish", and take "preversion" out entirely. That way, the repo will be free from derived code, but dist/ will still be published to npm so people can get react-tabs.min.js etc. from npmcdn.

@joepvl
Copy link
Collaborator Author

joepvl commented Jun 24, 2016

Fixed in 0.6.2 :).

@joepvl joepvl closed this as completed Jun 24, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant