Skip to content

Compiler options are expected in internal format #393

@slavafomin

Description

@slavafomin

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' }
  ),
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions