How to use the @tslab/typescript-for-tslab.ModuleResolutionKind function in @tslab/typescript-for-tslab

To help you get started, we’ve selected a few @tslab/typescript-for-tslab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yunabe / tslab / src / converter.ts View on Github external
(fileName, eventKind) => {
        sideInputsConverted.delete(fileName);
        callback(fileName, eventKind);
        if (options?._fileWatcher) {
          options._fileWatcher(fileName, eventKind);
        }
      },
      pollingInterval
    );
  };
  const host = ts.createWatchCompilerHost(
    [declFilename, srcFilename],
    {
      // module is ESNext, not ES2015, to support dynamic import.
      module: ts.ModuleKind.ESNext,
      moduleResolution: ts.ModuleResolutionKind.NodeJs,
      esModuleInterop: true,
      target: traspileTarget,
      declaration: true,
      newLine: ts.NewLineKind.LineFeed,
      // Remove 'use strict' from outputs.
      noImplicitUseStrict: true,
      typeRoots: getTypeRoots(),
      // allowJs, checkJs and outDir are necessary to transpile .js files.
      allowJs: true,
      checkJs: true,
      // tslab does not show error messages in d.ts (e.g. files in @types).
      // This may improve the compile performance slightly.
      skipLibCheck: true,
      // rootDir is necessary to stabilize the paths of output files.
      rootDir: cwd,
      outDir