mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
- most were added in ff8895103c8466694e7d8eeb734f51d2850670d8, but these two were missed - this should now cover all **thrown** errors - they only get thrown in the `options` hook, which does not implement Rollup's `this.error` - all other errors are already auto-prefixed by RollupContext etc
21 lines
571 B
TypeScript
21 lines
571 B
TypeScript
import { readFileSync } from "fs";
|
|
|
|
// The injected id for helpers.
|
|
export const TSLIB = "tslib";
|
|
export const TSLIB_VIRTUAL = "\0tslib.js";
|
|
export let tslibSource: string;
|
|
export let tslibVersion: string;
|
|
|
|
try
|
|
{
|
|
// tslint:disable-next-line:no-string-literal no-var-requires
|
|
const tslibPackage = require("tslib/package.json");
|
|
const tslibPath = require.resolve("tslib/" + tslibPackage.module);
|
|
tslibSource = readFileSync(tslibPath, "utf8");
|
|
tslibVersion = tslibPackage.version;
|
|
} catch (e)
|
|
{
|
|
console.warn("rpt2: Error loading `tslib` helper library.");
|
|
throw e;
|
|
}
|