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

Use custom ts paths resolve plugin #775

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

styfle
Copy link
Member

@styfle styfle commented Sep 16, 2021

No description provided.

let tsconfig = {};
try {
const configPath = join(process.cwd(), 'tsconfig.json');
const contents = fs.readFileSync(configPath, 'utf8')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using ts api to parse the config? It has type hint

const config = ts.readConfigFile(tsconfigPath, ts.sys.readFile).config;
const compilerOptions = ts.parseJsonConfigFileContent(
        config,
        ts.sys,
        './',
).options;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I'll probably go with the other PR instead #777

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

Successfully merging this pull request may close these issues.

None yet

2 participants