Skip to content

Commit

Permalink
Merge pull request #205 from clemyan/master
Browse files Browse the repository at this point in the history
fix: Babel transpiler fixes
  • Loading branch information
wessberg committed Aug 6, 2023
2 parents d8dcdf7 + 0ac3cea commit 9006025
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -122,11 +122,11 @@
"tslib": "^2.6.1"
},
"peerDependencies": {
"@babel/core": ">=6.x || >=7.x",
"@babel/runtime": ">=6.x || >=7.x",
"@babel/preset-env": ">=6.x || >=7.x",
"@babel/preset-typescript": ">=6.x || >=7.x",
"@babel/plugin-transform-runtime": ">=6.x || >=7.x",
"@babel/core": ">=7.x",
"@babel/runtime": ">=7.x",
"@babel/preset-env": ">=7.x",
"@babel/preset-typescript": ">=7.x",
"@babel/plugin-transform-runtime": ">=7.x",
"@swc/core": ">=1.x",
"@swc/helpers": ">=0.2",
"rollup": ">=1.x || >=2.x || >=3.x",
Expand Down
3 changes: 2 additions & 1 deletion src/transpiler/babel.ts
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
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 9006025

Please sign in to comment.