Skip to content

Commit d4bd359

Browse files
authored
chore: fix build error & github action (#366)
1 parent 0acf2ca commit d4bd359

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/pr-preview.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- name: Install dependencies
2525
run: npm install
2626

27+
- name: Build packages
28+
run: npm run build
29+
2730
- name: Set ARCO_SITE_DOMAIN
2831
run: echo "ARCO_SITE_DOMAIN=preview-${{ github.event.number }}-arco-design-mobile.surge.sh" >> $GITHUB_ENV
2932

@@ -79,7 +82,7 @@ jobs:
7982
8083
// Find if there's a comment created by us before 查找是否有我们之前创建的评论
8184
const botComment = comments.find(comment => {
82-
return comment.user.type === 'Bot' &&
85+
return comment.user.type === 'Bot' &&
8386
comment.body.includes('PR Preview Link');
8487
});
8588

packages/arcodesign/pack-util.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,25 @@ function changeBabelModule(moduleType) {
2323
];
2424
}
2525
});
26+
27+
const newPlugins = (babelConfig.plugins || []).map(plugin => {
28+
const pluginName = Array.isArray(plugin) ? plugin[0] : plugin;
29+
if (pluginName === '@babel/plugin-transform-runtime' && moduleType === 'umd') {
30+
const pluginOptions = Array.isArray(plugin) ? plugin[1] : undefined;
31+
return [
32+
'@babel/plugin-transform-runtime',
33+
{
34+
...(pluginOptions || {}),
35+
regenerator: false,
36+
},
37+
];
38+
}
39+
return plugin;
40+
});
2641
return {
2742
...babelConfig,
2843
presets: newPresets,
44+
plugins: newPlugins,
2945
};
3046
}
3147

0 commit comments

Comments
 (0)