ember-cli / ember-cli/ember-router-generator
Route generation fails when there is an if condition in the file
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
I have
```
Router.map(function () {
if (macroCondition(getOwnConfig().styleGuideIncluded)) {
this.route('style-guide');
}
})
```
to conditionally add a route based on config.
When I now run `ember generate route new-route` the generation fails. (I'm guessing on the if condition as unrecognized token?)
```
➜ ember generate route test-route
installing route
create app/routes/test-route.ts
create app/templates/test-route.hbs
Unexpected token (25:50)
Stack Trace and Error Report: /var/folders/9n/3zhdhb8959j9y02w5yc05zxc0000gn/T/error.dump.398d37c04279098c44d50061a23a6941.log
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.