1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var fs_extra_1 = require("fs-extra");
|
4 | var path_1 = require("path");
|
5 | var appRootDir = require("app-root-dir");
|
6 | var typescript_1 = require("typescript");
|
7 | function process(source, path) {
|
8 | var tsConfig = fs_extra_1.readJSONSync(path_1.join(appRootDir.get(), 'tsconfig.json'));
|
9 | if (path.endsWith('.ts') || path.endsWith('.tsx')) {
|
10 | return typescript_1.transpile(source, tsConfig.compilerOptions, path, []);
|
11 | }
|
12 | return source;
|
13 | }
|
14 | exports.process = process;
|