How to use the transpileModule function from typescript

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

147
148
149
150
151
152
153
154
155
156
  sourceMap: true,
  downlevelIteration: true,
  importHelpers: true,
  mapRoot: path.dirname(filePath),
};
const {outputText, sourceMapText} = ts.transpileModule(code, {compilerOptions});
return {
  code: outputText,
  map: JSON.parse(sourceMapText),
};
fork icon10
star icon9
watch icon6

+ 9 other calls in file

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

+ 164 other calls in file

130
131
132
133
134
135
136
137
138
139
  name: "widgets Loader",
  baseDataPath: "options",
});

if (filePath.indexOf("CompileCanvas") > -1) {
  const { outputText, sourceMapText } = ts.transpileModule(source, {
    compilerOptions: {
      sourceMap: true,
      module: ts.ModuleKind.CommonJS,
      jsx: ts.JsxEmit.React,
fork icon0
star icon0
watch icon1

+ 18 other calls in file

102
103
104
105
106
107
108
109
110
111
    plugins: [
      [freshPlugin, {skipEnvCheck: true}],
      ['@babel/plugin-syntax-typescript', {isTSX: true}],
    ],
  }).code;
  const compiled = ts.transpileModule(typescriptSource, {
    module: ts.ModuleKind.CommonJS,
  }).outputText;
  return executeCompiled(compiled);
}, testTypescript);
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)