-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix presets array bug #224
Conversation
unblocks ember-cli/ember-cli#7848 and fixes ember-cli/ember-cli#7850 |
/cc @stefanpenner and @kellyselden |
index.js
Outdated
@@ -221,9 +221,13 @@ module.exports = { | |||
userPostTransformPlugins | |||
).filter(Boolean); | |||
|
|||
options.presets = [ | |||
shouldRunPresetEnv && this._getPresetEnvPlugins(addonProvidedConfig), | |||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be easier to add .filter(Boolean)
here instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the condition is easier to read than &&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree with @rwjblue, I think the consistency with the above .filter(Boolean)
would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
peer pressure 😝
In `ember-cli` when using `DELAYED_TRANSPILATION` feature, we explicitly set `disablePresetEnv` flag to `true`. `shouldRunPresetEnv` is a negation of `disablePresetEnv`. Prior to this change `options.presets` was an array with one `false` item in it (`shouldRunPresetEnv` was set to `false`) and would let files be transplied when `DELAYED_TRANSPILATION` was enabled. Useful links: + https://github.com/ember-cli/ember-cli/blob/2e0cade64c4698cc48b1fdc20fda2219e63cc973/lib/models/addon.js#L256
@rwjblue @kellyselden comment addressed, I can't merge so w/e you're ready 😺 |
I’ll get it released in an hour or so... |
Released in v6.14.1 |
In
ember-cli
when usingDELAYED_TRANSPILATION
feature, we explicitlyset
disablePresetEnv
flag totrue
.shouldRunPresetEnv
is anegation of
disablePresetEnv
.Prior to this change
options.presets
was an array with onefalse
item in it (
shouldRunPresetEnv
was set tofalse
) and would not let filesbe transplied when
DELAYED_TRANSPILATION
was enabled.Useful links: