Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using --project switch incorrectly outputs to include base folder name #837

Open
bbugh opened this issue Jul 19, 2024 · 0 comments
Open

Comments

@bbugh
Copy link

bbugh commented Jul 19, 2024

Given this tsconfig.json

{
  "compilerOptions": {
    "outDir": "./dist",
  },
  "include": ["src/**/*.ts"]
}

When running npx sucrase -p ., it incorrectly outputs to dist/src instead of treating src as a base directory.

# ❌ it should not be this
/path/src/main.ts -> /path/dist/src/main.js

# ✅ it should be this
/path/src/main.ts -> /path/dist/main.js

Adding the rootDir configuration setting does not affect this

// No change
{
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./dist",
  },
  "include": ["src/**/*.ts"]
}

And if I exclude "include", sucrase doesn't output anything.

{
  "compilerOptions": {
    "rootDir": "./src", // with or without this, doesn't matter
    "outDir": "./dist",
  },
  //"include": ["src/**/*.ts"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant