emberjs / emberjs/ember-cli-babel

Configuring addon test build

Open
#196 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
152
Forks
115
Avg merge
23h 22m
Merged PRs (30d)
4

Description

I have an addon that uses `async/await` in its `addon/` directory and its `tests/` directory.

I figured that since I'm testing on a modern headless Chrome, I could skip the transform for `async/await`. I tried

```js
// ember-cli-build.js
let app = new EmberAddon(defaults, {
babel: {
exclude: [
'transform-async-to-generator',
'transform-regenerator',
],
},
})
```

on the assumption that that would apply to both `addon/` and `tests/` **when building the dummy app**. It worked for `tests.js`, but not `vendor.js`. I still see `regeneratorRuntime.wrap` for each `async` method in `addon/`.

I'm _not_ trying to control what happens when my addon gets used in another app. That app knows more about its target browsers and should be able to determine what transforms are needed.

I can turn off the transforms for `addon/` if I configure `index.js`:
```js
// index.js
module.exports = {
name: '@my/addon',

babel: {
exclude: [
'transform-async-to-generator',
'transform-regenerator',
]
}
}
```

But that's going to affect any consuming app as well, which I don't want to do.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.