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

Compiler options are expected in internal format #393

Closed
slavafomin opened this issue Feb 25, 2020 · 2 comments
Closed

Compiler options are expected in internal format #393

slavafomin opened this issue Feb 25, 2020 · 2 comments
Labels

Comments

@slavafomin
Copy link

slavafomin commented Feb 25, 2020

Current behavior

When passing compiler options in the external format (like in tsconfig.json and like it stated in the plugin's documentation) it fails to parse "enumerated" fields like moduleResolution with the error like this: Unexpected moduleResolution: Node.

Expected behavior

It should parse such fields correctly.

Steps to reproduce the issue

Pass this config:

{ moduleResolution: 'Node' }

Environment

  • fork-ts-checker-webpack-plugin: ^4.0.4
  • typescript: ^3.7.2
  • webpack: ^4.41.0
  • os: Ubuntu 18.04.4 LTS, Linux 5.3.0-40-generic

Workaround

Use convertCompilerOptions() from @moebius/ts-compiler-options to convert options from external format to internal first:

new ForkTsCheckerWebpackPlugin({
  compilerOptions: convertCompilerOptions(
    'external-to-internal',
    { moduleResolution: 'Node' }
  ),
})
@piotr-oles
Copy link
Collaborator

There is a function provided by the TypeScript itself: ts.convertCompilerOptionsFromJson :) It will be used in the 5.0.0 release :)

@piotr-oles
Copy link
Collaborator

@slavafomin
Please try fork-ts-checker-webpack-plugin@alpha - I've published a new version which should resolve this issue 🚀
I will close this issue to clean-up the backlog. If this release didn't solve the issue, we can re-open this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants