Commit 0809fc8
authored
feat(babel-preset-app): pass full config to @babel/preset-env (#5522)
Pass not just the useBuiltIns and corejs options, but the whole
envOptions object, into the @babel/preset-env preset that is used to
transform @babel/runtime, just like for the @babel/preset-env that is
used for the application source code. This allows users to also specify
other options, such as `exclude` and `polyfills`, and have them apply
here too.
In particular, this can be used to exclude the Promise polyfill, e. g.
if Promise is already polyfilled in some other way. Previously,
exclude: ['es.promise'],
polyfills: ['es.array.iterator', 'es.object.assign'],
could be used to configure the preset for the application source code,
but the babel runtime would be transformed without those options, and so
es.promise would still end up being included.
Closes #52081 parent 34f303b commit 0809fc8
File tree
2 files changed
+16
-4
lines changed- packages/@vue/babel-preset-app
- __tests__
2 files changed
+16
-4
lines changedLines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 249 | + | |
253 | 250 | | |
254 | 251 | | |
255 | 252 | | |
| |||
0 commit comments