What's the best practice when you need to build a package before publishing? #1136
Unanswered
supersabillon
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Hi @supersabillon , Saw your question while I was looking for the same thing. Turns out it isn't event changeset's responsibility. There's a special lifecycle script exactly for this. Put this in every "scripts": {
"prepare": "//put your build command here//"
} More info here: https://docs.npmjs.com/cli/v6/using-npm/scripts#life-cycle-scripts |
Beta Was this translation helpful? Give feedback.
0 replies
-
@antariandel would the prepare script only run the build for the package that will be published or would it build everything in the repo? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you have package that needs to be built/transpiled with webpack/vite/parcel/rollup etc, what's the best way to do this with Changesets?
My current solution is to:
and my release command:
The drawback here is that im building EVERYTHING under /packages, when perhaps only 1 package might need to publish. Also the command always runs even if they are no packages to publish so I would really wish to keep the scope of the build step super minimal.
The ideal workflow would be to have changeset run a
build
command for only the package we want to publish. Is this possible?Beta Was this translation helpful? Give feedback.
All reactions