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

Define multiple browser targets for a single build #200

Open
mm2ha opened this issue Jan 27, 2018 · 2 comments
Open

Define multiple browser targets for a single build #200

mm2ha opened this issue Jan 27, 2018 · 2 comments

Comments

@mm2ha
Copy link

mm2ha commented Jan 27, 2018

First of all, I am not sure if this is a question for ember-cli-babel or ember-cli.

I am wondering if there is any way to accomplish having ember build generate 2 different JS and CSS sets of files based on 2 different target browsers definition. The first package would have regular names and the second could have "-legacy" appended for example.

The use case for this is the following - we would like to serve non-transpiled source code to browsers that support it, and regular transpiled code to all others.

Any suggestions on how this could be accomplished are greatly appreciated!

@astronomersiva
Copy link
Contributor

We were also trying to do this and had some success recently. If you use ember-cli-deploy and the lightning strategy, you will have to generate two builds(one transpiled and another non-transpiled using ENV variables) and make the build label of the second build as ${first_build_label}-legacy. When serving the build, detect the browser and send the index.html of ${latest_build_label}-legacy.

@BryanCrotaz
Copy link

I'm doing this but I'm having issues with addons. The addon babel config seems to be separate from the app config. So when I build the app for legacy browsers (eg transforming async to promises) the addons aren't transpiled.

How did you solve this?

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

3 participants