Skip to content

Commit aea04f8

Browse files
author
jianxun.zxl
committed
fix: preset loading
1 parent 39602c7 commit aea04f8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,13 @@ class BabelProcessor {
7272
try {
7373
config.presets && config.presets.forEach((v, i, a) => {
7474
if (Array.isArray(v) && typeof v[0] === 'string') {
75-
v[0] = '@babel/preset-' + v[0];
75+
if (!v[0].startsWith('@babel/')) {
76+
v[0] = '@babel/preset-' + v[0];
77+
}
7678
} else if (typeof v === 'string') {
77-
a[i] = '@babel/preset-' + v;
79+
if (!v.startsWith('@babel/')) {
80+
a[i] = '@babel/preset-' + v;
81+
}
7882
}
7983
});
8084
config.plugins && config.plugins.forEach((v, i, a) => {

0 commit comments

Comments
 (0)