Run scripts in a subfolder package.json #5333
Unanswered
jakeboone02
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I posted this same question on SO but I thought maybe here would be a better place to ask.
I maintain a monorepo for the
react-querybuilder
package. I merged in the documentation website code under the/website
directory, but not as a workspace (those are in/packages/*
).The
/website
directory has its ownpackage.json
with thedocusaurus *
scripts (start
/build
/deploy
/etc.). I'd like to have scripts in the root/package.json
that execute the scripts in/website/package.json
. Currently I have something like this in/package.json
:Is there a better, more generic way to do that? This way I have to name every script twice, once in
/package.json
and once in/website/package.json
.(I tried
--cwd
, but that doesn't actually run scripts defined in that other directory'spackage.json
. It runs the scripts defined in the rootpackage.json
from the other directory. E.g.,yarn --cwd website build
is effectively the same asyarn build
, at least in my case.)I thought there might be a
yarn
flag like--cwd
(--pkg
?--config
?) that actually runs the scripts defined in the other directory, or maybe you'd have to specify a file.Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions