Skip to content

Commit f49f599

Browse files
fix(babel): let babel load the presets
v7.0.0-beta.41 added `assertVersion` and a wrapper around each plugin that checks the babel API version. Since we were manually loading the presets here we weren't supplying the babel API. Using just the preset names means that babel will load them for us and everything should work as expected. babel/babel@a479540#diff-b4beead8ad9195361b4537601cc22532
1 parent 8c116e1 commit f49f599

3 files changed

Lines changed: 398 additions & 317 deletions

File tree

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@
6868
"yarnhook": "^0.1.1"
6969
},
7070
"dependencies": {
71-
"@babel/core": "^7.0.0-beta.40",
72-
"@babel/generator": "^7.0.0-beta.40",
73-
"@babel/preset-env": "^7.0.0-beta.40",
74-
"@babel/preset-typescript": "^7.0.0-beta.40",
75-
"@babel/traverse": "^7.0.0-beta.40",
76-
"@babel/types": "^7.0.0-beta.40",
71+
"@babel/core": "^7.0.0-beta.42",
72+
"@babel/generator": "^7.0.0-beta.42",
73+
"@babel/preset-env": "^7.0.0-beta.42",
74+
"@babel/preset-typescript": "^7.0.0-beta.42",
75+
"@babel/traverse": "^7.0.0-beta.42",
76+
"@babel/types": "^7.0.0-beta.42",
7777
"get-stream": "^3.0.0",
7878
"glob": "^7.1.2",
7979
"got": "^8.1.0",

src/transpile-requires.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export function hook(code: string, filename: string): string {
3030

3131
if (!useBabelrc) {
3232
if (ext === '.ts') {
33-
options.presets.push(require('@babel/preset-typescript').default());
33+
options.presets.push('@babel/preset-typescript');
3434
}
3535

36-
options.presets.push(require('@babel/preset-env').default());
36+
options.presets.push('@babel/preset-env');
3737
}
3838

3939
return transform(code, options).code as string;

0 commit comments

Comments
 (0)