-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Custom tsconfig.json #51
Comments
currently, the ts config is hardcoded in runtime.ts |
@jedmao Deno doesn't have that logic yet - it only uses one built in set of tsconfig. Coming soon. |
Sounds like a roadmap item? Perhaps we can discuss and formalize the requirements in this issue and add it to a milestone? |
On the surface, I think these are the problems or scenarios that need to be discussed for this issue:
Any thoughts on this or better ideas? |
@jedmao I will deal with it. |
@ry just so you know, I'm willing to help where I can. I'd love to contribute to this project. |
@jedmao Sure - I think the way to get started is to use this function and |
Looks like |
Expect on this improvement. I'm wondering how will the module system handle the external code using path alias: // https://example.com/ext-pkg/tsconfig.json
{
"compilerOptions": {
"paths": {
"~src/*": ["src/*"]
}
}
// https://example.com/ext-pkg/index.ts
import foo from '~src/util/b' |
@zheeeng if you're publishing a TypeScript library I think you would make sure not to use paths like that. |
@jedmao For not import module importer(e.g. require.js) in the browser env, developers often use Rollup/Webpack to bundle modules and provide a .d.ts declarations entry. The downstream lib could use the lib as js lib + .d.ts. These two pack tools all support path alias. Plz consider this usage and not force modification on them. |
@zheeeng I was thinking how to write module imports that will support both, node & deno, and thats brilliant idea using tscofnig paths it can be done very easily, in future I already plan to organize code so to support both platforms (until there will be stable version of deno) and I think supporting paths is very important |
The thing that concerns me is that |
There's upcoming typescript features (3.0ish) to handle build "nested" typescript projects |
@Bnaya I read that first lengthy post and I'm still not seeing anything that allows you to import a TS file and that TS file tells you where to find the tsconfig.json. Remember that you can have two separate tsconfig.json files that build the same TS file. The only solution I can think of is to put some kind of comment at the top of the TS file, but I'm not loving that idea. |
importing single ts file, without any metadata, is not a good idea imo. |
@Bnaya, I agree. That's what I'm trying to figure out here in this thread. Do you have any suggestions that would work? Because currently, it looks like Deno will support single-file imports. I don't think the links you shared solve this problem. |
I am going to take a look at this now. The compiler has settled down to a point where I think we can start to deal with this. There are a few approaches that could be taken, and I am not sure which is best:
I would want to put the restriction that all modules will be transpiled with the same set of options for that programme. Adjusting it for each one is going to be problematic and confusing to the user. My feeling at the moment of the only TypeScript compiler options we would want to support are:
So that is 6 options we can realistically support out of about 75 options that can be specified in the Also, since we have a default behaviour of @ry thoughts? |
Talking to @ry, we discussed that option 1 listed above is a better approach. Deno will support the |
Just an update on this issue: We are still heavily refactoring the core compilation infrastructure, so we're putting off adding stuff like that until it solidifies. In particular, we won't attempt address this until #975 is done. |
CC @kitsonk can you give an update on this issue? |
There is still some refactoring churn on the compiler. It is in the queue after that. |
@kitsonk what is the status this issue? |
It is being worked on. |
What happens or should happen if you import a TS file that has different compiler options? Does/will deno look for a separate
tsconfig.json
somehow?The text was updated successfully, but these errors were encountered: