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

If an object is supplied as tsconfig, use that rather than a file #208

Closed
alshdavid opened this issue Feb 28, 2020 · 6 comments
Closed

If an object is supplied as tsconfig, use that rather than a file #208

alshdavid opened this issue Feb 28, 2020 · 6 comments
Labels
kind: feature New feature or request problem: stale Issue has not been responded to in some time solution: workaround available There is a workaround available for this issue

Comments

@alshdavid
Copy link

alshdavid commented Feb 28, 2020

Allow users to specify the tsconfig configuration inline in the rollup plugin configuration

rollup.config.js

plugins: [
  typescript({
    tsconfig: {
      compilerOptions: {...etc}
    }
  })
]
@ezolenko
Copy link
Owner

You can achieve almost the same result using tsconfigDefaults and tsconfigOverride options, see readme.

@alshdavid
Copy link
Author

Because of the deep merge strategy, I'm unable to omit a path without creating a new tsconfig.json

@ezolenko
Copy link
Owner

ezolenko commented Feb 29, 2020

You could create a new tsconfig file and set its path in tsconfig option (lets you set a custom tsconfig path/name). Either leave it empty and set other options in tsconfigOverride or just set the options there directly.

@alshdavid
Copy link
Author

Currently I'm loading the users tsconfig with require(), making my changes and then storing the modified version in the .cache directory.

This works but is kinda gross

@ezolenko ezolenko added the kind: bug Something isn't working properly label Mar 4, 2020
@ezolenko
Copy link
Owner

ezolenko commented Mar 4, 2020

Yeah, I'll eventually look at doing shallow merge where appropriate, but that's something that will need maintenance going forward (in case of tsconfig format changes)

@agilgur5 agilgur5 added kind: feature New feature or request solution: workaround available There is a workaround available for this issue and removed kind: bug Something isn't working properly labels Apr 23, 2022
@agilgur5 agilgur5 changed the title If an object is supplied as the tsconfig options field, use that rather than a file If an object is supplied as tsconfig, use that rather than a file Apr 23, 2022
@agilgur5 agilgur5 added the problem: stale Issue has not been responded to in some time label Jun 23, 2022
@agilgur5
Copy link
Collaborator

agilgur5 commented Sep 5, 2022

Hi folks, just doing some housekeeping in the issues. I'm going to close this one out as it's gone quite stale (no comments in 2.5+ years) and has no upvotes, so it doesn't seem to be a popular feature to implement and maintain (note that this is a volunteer, unpaid project). There are also various workaround available for this, so those may be better suited to solve this given the lack of popularity.

tsc also requires a tsconfig.json so we don't want to stray too far from that either.

With regard to shallow merging, that is a separate issue, and a bug that needs to be fixed in a breaking change eventually. Please see #86 for that.

@agilgur5 agilgur5 closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New feature or request problem: stale Issue has not been responded to in some time solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

3 participants