Skip to content

Commit

Permalink
fix: resolve @babel/plugin-syntax-dynamic-import from @babel/preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
clemyan committed Aug 6, 2023
1 parent d8dcdf7 commit 66cb727
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/transpiler/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export function getForcedBabelOptions({cwd}: GetForcedBabelOptionsOptions): Tran
sourceType: "module",
plugins: [
// Needed to make babel understand dynamic imports
resolveModule("@babel/plugin-syntax-dynamic-import")
// TODO: Add @babel/plugin-syntax-dynamic-import as an optional peer for next major
resolveModule("@babel/plugin-syntax-dynamic-import", resolveModule("@babel/preset-env"))
]
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/path/path-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {ensureArray} from "../ensure-array/ensure-array.js";
import {createRequire} from "module";

// Until import.meta.resolve becomes stable, we'll have to do this instead
export const resolveModule = createRequire(import.meta.url).resolve;
export const resolveModule = (id: string, from: string = import.meta.url) => createRequire(from).resolve(id);

export function isTypeScriptLib(p: string): boolean {
return p.startsWith(`lib.`) && p.endsWith(D_TS_EXTENSION);
Expand Down

0 comments on commit 66cb727

Please sign in to comment.