Skip to content

Commit

Permalink
Merge pull request #236 from LRCong/master
Browse files Browse the repository at this point in the history
变更nuxt-builder编译目标环境
  • Loading branch information
starkwang authored Aug 24, 2021
2 parents a4099b4 + 10d05b3 commit d575f47
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/cloudbase-nuxt-builder/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ interface NuxtBuilderBuildOptions {

async function transformToEs5(code: string) {
return new Promise((resolve, reject) => {
transform(code, { presets: ['@babel/preset-env'] }, (err, result) => {
if (err) {
reject(err);
}
if (result) {
resolve(result.code);
}
});
transform(code, {
presets: [['@babel/preset-env', { targets: { node: '10.15' } }]]
},
(err, result) => {
if (err) {
reject(err);
}
if (result) {
resolve(result.code);
}
});
});
}

Expand Down

0 comments on commit d575f47

Please sign in to comment.