How to use the ModuleKind function from typescript

Find comprehensive JavaScript typescript.ModuleKind code examples handpicked from public code repositorys.

140
141
142
143
144
145
146
147
148
149
const downlevelToES2015Plugin = {
  name: 'downlevel-to-es2015',
  transform: (code, filePath) => {
    const compilerOptions = {
      target: ts.ScriptTarget.ES2015,
      module: ts.ModuleKind.ES2015,
      allowJs: true,
      sourceMap: true,
      downlevelIteration: true,
      importHelpers: true,
fork icon10
star icon9
watch icon6

+ 9 other calls in file

486
487
488
489
490
491
492
493
494
495
}
// Transpile test scripts
function transpileScript(script) {
    var output = ts.transpileModule(script, { compilerOptions: {
            target: ts.ScriptTarget.ES2015,
            module: ts.ModuleKind.CommonJS,
            esModuleInterop: true,
        } });
    return output;
}
fork icon0
star icon3
watch icon1

+ 164 other calls in file

124
125
126
127
128
129
130
131
132
133
    if (origin && origin.module === '@angular/core' && origin.name === 'Component') {
        return true;
    }
    return false;
}
function createResourceImport(node, loader, resourceImportDeclarations, moduleKind = ts.ModuleKind.ES2015) {
    const url = getResourceUrl(node, loader);
    if (!url) {
        return null;
    }
fork icon0
star icon0
watch icon1

+ 3 other calls in file

22
23
24
25
26
27
28
29
30
31
const compilerOptions = {
    noEmitOnError: useLibs,
    allowJs: true,
    newLine: ts.NewLineKind.LineFeed,
    moduleResolution: ts.ModuleResolutionKind.NodeJs,
    module: ts.ModuleKind.ESNext,
    target: ts.ScriptTarget.ESNext,
    skipLibCheck: true,
    sourceMap: false,
    importHelpers: true,
fork icon0
star icon0
watch icon1

Other functions in typescript

Sorted by popularity

function icon

typescript.SyntaxKind is the most popular function in typescript (82777 examples)