How do I compile multiple directories at the same time? #2815
Unanswered
claytoneast
asked this question in
Q&A
Replies: 2 comments 3 replies
-
|
any updates on this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I have created this issue: #8139 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First off, apologies if I could have pieced together what might be an already-existing way to do this from the docs. I've been reading them and experimenting for 3 hours now, and I can't figure it out.
I have an app. The relevant pieces of directory structure of this app:
We use typescript, and thus
tsc. In ourtsconfig.json, we have (relevant opts only here)This allows us to run
tsc, and get all the things in ourincludeoption paths compiled into thedistdirectory.I'm wondering if
swchas a good way to do this. I have a really bad way to do it:in conjunction with
$ ./node_modules/.bin/swc ./* -d dist/src --config-file .swcrcIt's bad because while
swconly takes between 300ms and 900ms to compile, the entire command takes ~5s. I'm guessing it takes this long because I'm setting the input directory as the entire app folder, and soswchas to get every file within the app, test it against the "test" and "exclude" patterns, etc (thanksnode_modulesw/ 43k files).Another terrible way that I thought of (but haven't tried) would be to start 3 separate
swcprocesses, each pointed at the respective directory I want.I don't really want to do that^ option either.
It seems like there should be a way to have an
includeoption, or asrcDirsoption, or something that lets me do this without scanning every single filename in my app directory. Would be really nice. It is the only thing preventing us from switching right now, and boy would it be awesome to switch, the compile speed is like playing a game at 10fps, upgrading your computer, and having it run at 120fps. It's so nice.Please let me know if there is some config option that does this (that I am apparently incapable of reading and understanding), or if this isn't supported yet.
Thanks!!
Beta Was this translation helpful? Give feedback.
All reactions