@digitak/grubber
Version:
Parse code files and patch it without having to use an AST
11 lines (10 loc) • 635 B
TypeScript
import { AliasResolver } from "./resolveAliases.js";
/**
* When Typescript compiles dependencies, it adds no '.js' extension at the end of imports.
* The problem is: browser, Node and Deno all need this '.js' extension.
* (Thanks #TypescriptTeam for not being standard, look at all the additional work you make me do!)
* (All this work for three stupid letters!...)
* (Love your work though, Typescript is an awesome language <3)
* This utility function can be used after a Typescript compilation to add the mandatory '.js'
*/
export default function patchJsImports(directories: string[], aliases?: Array<AliasResolver>): void;