-
Notifications
You must be signed in to change notification settings - Fork 52
Nested src dir shows up in out dir #108 #123
base: main
Are you sure you want to change the base?
Conversation
kimhongsu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
I changed the function signature so I couldn't make this pull request pass the test. |
Can you update the referenced functions, too? cc @kwonoj @alexander-akait |
I should have tested |
First of all, I would like to suggest consolidate effort to new CLI (swc-project/swc#3859 / https://github.com/swc-project/swc/blob/main/crates/swc_cli/src/commands/compile.rs) Secondly, I need to think about interfaces but the way I'm thinking is let user choose to specific CWD to calculate path to src / dest, instead of trying to calculate between src / dest. I haven't completely go through all possible cases though. Generally, I'm bit against let swc trying to traverse up to current working dir, but that's probably something we have to support anyway. |
@kwonoj Agree, the Anyway |
I wish I could write RUST. My problem is that I don't know RUST.
By the way the command below will And I'm still stuck into the argument type mismatch in watchCompilation(). I'm shameful. |
I resolved the type mismatch error. And I appended There is a failure on integration test. I'm not sure this error is related to my code. If so, please let me know.
|
Relative path support in CLI
$PWD
to point out the current directoryswc ../../src --out-dir dist
filenames
andoutDir
which are passed by arguments will be checked and converted to the absolute paths.const filenamesAbsolutePath = absolutePath(filenames, cwd);
const outDirAbsolutePath = slash(resolve(cwd, outDir));
Source directory layout will be maintained to the output directory. So Nested src dir shows up in out dir #108 will be resolved.
File.sourceLength
is the index of the user input's end(source directory length) in filename. I add Number type in File interface to minimize the memory consumption and the fast process using slice() function.And I think this will resolve the issue #2092 too.