Skip to content

feat(webpack): support env variables for index.html #1460

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

Closed
dzonatan opened this issue Jul 27, 2016 · 4 comments
Closed

feat(webpack): support env variables for index.html #1460

dzonatan opened this issue Jul 27, 2016 · 4 comments

Comments

@dzonatan
Copy link
Contributor

dzonatan commented Jul 27, 2016

It would be great to still have some kind of env variables or settings for index.html as we had previously with broccoli.
One of the use case would be setting <base href for different environments which I need now...

@filipesilva
Copy link
Contributor

I don't think we ever supported adding custom variables to index.html, but there is a feature request for the base tag already in #1064.

@dzonatan
Copy link
Contributor Author

dzonatan commented Jul 28, 2016

You did.. At least I was able to use any env variable by {{environment.myVar}} interpolation.
So in my case it was <base href="{{environment.baseHref}}">.

Even originally the new project had some usages:

{{#unless environment.production}}
  <script src="/ember-cli-live-reload.js" type="text/javascript"></script>
{{/unless}}

So I think it's kinda breaking change after webpack merge.

Update:
Also baseURL in config/environment.js has no impact at all. I was trying to use it to make my dev server same as prod (to serve under some specific base href).

@filipesilva
Copy link
Contributor

Huh, that must have been base functionality of ember-cli that we never really noticed. The best I can do now is to bump the priority of that base href feature, I'll try to work on it soon.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants