Skip to content
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

Use browsers from new targets config #88

Closed
mydea opened this issue May 2, 2017 · 6 comments
Closed

Use browsers from new targets config #88

mydea opened this issue May 2, 2017 · 6 comments

Comments

@mydea
Copy link

mydea commented May 2, 2017

When using this addon together with e.g. 'autoprefixer', you currently configure autoprefixer like this:

plugins: [
  {
    module: autoprefixer,
    options: {
      browsers: ['last 2 versions', 'ie > 9', 'ios >= 8', '> 5%']
    }
]

Following the new possibilities as outlined here: http://rwjblue.com/2017/04/21/ember-cli-targets/, you can now have a config/targets.js file like this:

module.exports = {
  browsers: ['> 5%']
};

It would be great if we could use that config if no browsers are set directly for autoprefixer (and possibly other plugins).

@mydea
Copy link
Author

mydea commented May 2, 2017

Also see: kimroen/ember-cli-autoprefixer#34

@jeffjewiss
Copy link
Owner

@mydea thanks for submitting this! Yeah, I think this is a great idea. After reading over the article and other repo you mentioned, I think it would make sense to add project.target.browsers to each plug-in's base options object as options.browsers, which could then be overridden on a per plug-in basis and should follow the formatting expected by a plug-in like autoprefixer.

Does that sounds like what you had in mind? Is there anything I'm missing?

Cheers, thanks!

@mydea
Copy link
Author

mydea commented May 3, 2017

Yes, that sounds perfect!

@jeffjewiss
Copy link
Owner

@mydea would you be able to help me test this? I have this ready on the branch support-project-targets with updates to the underlying broccoli plugins. Having another set of eyes on this would be a big help. Thanks!

@mydea
Copy link
Author

mydea commented Jun 13, 2017

Awesome, I tried it out with the branch, and it seemed to work just fine!

@jeffjewiss
Copy link
Owner

@mydea thanks for the help! I've published this as V3.4.1, which should support using config/target.js and overriding the options in compile, filter and on a per plugin basis.

Please open a new issue if there are any bugs with this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants