You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 inlib/
to umd indist/
during"preversion"
; need to make surenpm run build
is run beforenpm 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 thefiles
array inpackage.json
can be used without actually includingdist/
in the repo (just need to make sure it's there when younpm publish
, which you can do using the"prebublish"
script). That said, apparently this package still supports bower (at least for now), so it needsdist/
in the repo as well as on npm.Anway, as far as I can tell this issue happens because the
build:umd
andbuild:umd:min
commands depend onlib/
containing the right files to build into umd and minify. However, the"preversion"
script (used to updatedist/
in the repo when runningnpm version
) doesn't includenpm run build
(which updateslib/
with the commonjs build), and the"prepublish"
script doesn't includenpm run bundle
. So basicallydist/
never gets updated unless you run the extra scripts manually 😭 .One solution would be to change
"preversion"
to includenpm run build
beforenpm run bundle
. That way,lib/
will be updated with the commonjs build before building todist/
, and you'll be able to get the latest build from both bower and npmcdn aftergit push
andnpm publish
respectively.When the time comes to drop bower support, you'd
git rm dist/
, adddist/
to.gitignore
, adddist/
to the"clean"
script, addnpm run bundle
to the end of"prepublish"
, and take"preversion"
out entirely. That way, the repo will be free from derived code, butdist/
will still be published to npm so people can getreact-tabs.min.js
etc. from npmcdn.The text was updated successfully, but these errors were encountered: