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

need an option to control whether enable or disable project reference #4211

Closed
Tracked by #4033
hardfist opened this issue Sep 18, 2023 · 2 comments · Fixed by #4290
Closed
Tracked by #4033

need an option to control whether enable or disable project reference #4211

hardfist opened this issue Sep 18, 2023 · 2 comments · Fixed by #4290
Assignees
Labels
team The issue/pr is created by the member of Rspack.

Comments

@hardfist
Copy link
Contributor

          we need an option to control whether enable or disable project reference, so I suggest following options
module.exports = {
resolve: {
  tsconfig: {
    configFile: './tsconfig.json',
    references: ['./a/tsconfig.json', './b.tsconfig.json'] | 'auto' | undefined 
    // undefined or no value means don't enable project reference
    // 'auto' means enable auto project reference
    // ['./a/tsconfig.json','./b/tsconfig.json'] means manual config project reference
 }
}
}

and current tsConfigPath is just syntax sugar

{
  resolve: { 
   tsConfigPath: './tsconfig.json'
 }
}

is syntax sugar of the following and will be deprecated in the future

{
 resolve: { 
   tsconfig:{
     configFile: './tsconfig'
    }
}
}

Originally posted by @hardfist in #4192 (comment)

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Sep 18, 2023
@hardfist
Copy link
Contributor Author

hardfist commented Sep 25, 2023

I think this is the main blocker for modernjs to implement sourceBuild mode on rspack, @chenjiahan may add more context about it, cc @Boshen

@chenjiahan
Copy link
Member

Modern.js provides a source code build mode, it allows developers to directly reference the source code of other sub-projects within the monorepo for development.

When using webpack, Modern.js uses the references option of tsconfig-paths-webpack-plugin to support TypeScript project references, so that the use of aliases in the sub-project works correctly.

And when using Rspack, we want to take the same behavior, so it would be nice if Rspack can provide an option to control the references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants