mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
Add .js extension to virtual tslib (#170)
This commit is contained in:
parent
07d9a9c0dc
commit
dca40becaf
@ -10,7 +10,7 @@ import { IOptions } from "./ioptions";
|
||||
import { Partial } from "./partial";
|
||||
import { parseTsConfig } from "./parse-tsconfig";
|
||||
import { printDiagnostics } from "./print-diagnostics";
|
||||
import { TSLIB, tslibSource, tslibVersion } from "./tslib";
|
||||
import { TSLIB, TSLIB_VIRTUAL, tslibSource, tslibVersion } from "./tslib";
|
||||
import { blue, red, yellow, green } from "colors/safe";
|
||||
import { dirname, isAbsolute, join, relative } from "path";
|
||||
import { normalize } from "./normalize";
|
||||
@ -125,7 +125,7 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
|
||||
resolveId(this: PluginContext, importee: string, importer: string | undefined)
|
||||
{
|
||||
if (importee === TSLIB)
|
||||
return "\0" + TSLIB;
|
||||
return TSLIB_VIRTUAL;
|
||||
|
||||
if (!importer)
|
||||
return;
|
||||
@ -162,7 +162,7 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
|
||||
|
||||
load(id: string)
|
||||
{
|
||||
if (id === "\0" + TSLIB)
|
||||
if (id === TSLIB_VIRTUAL)
|
||||
return tslibSource;
|
||||
|
||||
return null;
|
||||
|
||||
@ -2,6 +2,7 @@ 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user