MCPcopy Create free account
hub / github.com/rollup/plugins / getTsLibPath

Function getTsLibPath

packages/typescript/src/tslib.ts:18–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 * Returns code asynchronously for the tslib helper library.
17 */
18export const getTsLibPath = () => {
19 // Note: This isn't preferable, but we've no other way to test this bit. Removing the tslib devDep
20 // during the test run doesn't work due to the nature of the pnpm flat node_modules, and
21 // other workspace dependencies that depenend upon tslib.
22 try {
23 // eslint-disable-next-line no-underscore-dangle
24 return resolveId(process.env.__TSLIB_TEST_PATH__ || 'tslib/tslib.es6.js', {
25 // @ts-ignore import.meta.url is allowed because the Rollup plugin injects the correct module format
26 basedir: fileURLToPath(new URL('.', import.meta.url))
27 });
28 } catch (_) {
29 return null;
30 }
31};

Callers 1

getPluginOptionsFunction · 0.90

Calls 1

resolveIdFunction · 0.70

Tested by

no test coverage detected