-
Notifications
You must be signed in to change notification settings - Fork 33
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
If !shouldIncludeStyleguide
, exclude the instance initializer
#27
Conversation
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.
Thanks so much for this!
Would you be able to update import-files-test.js
to assert that the initializer is removed?
index.js
Outdated
return new Funnel(appTree, { | ||
exclude: ['**/instance-initializers/ember-cli-tailwind.js'], | ||
}); | ||
}, |
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 prefer not to have early returns, could we change the style to
treeForApp(tree) {
let appTree = this._super(tree);
if (!this._shouldIncludeStyleguide()) {
appTree = new Funnel(appTree, {
exclude: ['**/instance-initializers/ember-cli-tailwind.js'],
});
}
return appTree;
}
@samselikoff Done 👍 |
It looks like this change supports item no 2 #17 |
Thank you! |
This change is needed for projects with module unification enabled. |
@jrowlingson it's been released in 0.6.0 |
I tried using this addon in an engine, and the instance initializer's
import Router from '../router';
would error because there is no router there.I'm not sure the best way to make this fully support engines, but best I could tell the instance initializer is only relevant when the styleguide is enabled. This PR excludes the instance initializer from the app tree if
shouldIncludeStyleguide
is false, which means it can be used in engines, at least.