1 | import { readFileSync } from "fs";
|
2 |
|
3 | // The injected id for helpers.
|
4 | export const TSLIB = "tslib";
|
5 | export let tslibSource: string;
|
6 | export let tslibVersion: string;
|
7 | try
|
8 | {
|
9 | // tslint:disable-next-line:no-string-literal no-var-requires
|
10 | const tslibPackage = require("tslib/package.json");
|
11 | const tslibPath = require.resolve("tslib/" + tslibPackage.module);
|
12 | tslibSource = readFileSync(tslibPath, "utf8");
|
13 | tslibVersion = tslibPackage.version;
|
14 | } catch (e)
|
15 | {
|
16 | console.warn("Error loading `tslib` helper library.");
|
17 | throw e;
|
18 | }
|