Anton Gilgur 0628482ea2
feat: add rpt2 prefix to remaining errors (#382)
- 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
2022-07-12 09:56:03 -06:00

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;
}