Comments (10)
Hi @lolmaus. Do you have a reproduction project? Unfortunately I'm not using this with any FastBoot projects at the moment.
from ember-cli-dotenv.
@kratiahuja do you mind to share some thoughts or ideas about how to solve this issue? I faced the same problem and I'd like to contribute to the addon to support that feature but have a difficult time thinking about how to integration this into ember-cli-fastboot properly.
from ember-cli-dotenv.
How about write it to the package.json of Fastboot as part of the app config? I am working on exposing an API on fastboot where you can write additional config at build time and read it in Fastboot via FastBoot.config
from ember-cli-dotenv.
How about write it to the package.json of Fastboot as part of the app config?
That would work and that's what I;d like to achieve!
The main problem here is: how to make some config to appear in package.json and do not appear in <meta name="{{modulePrefix}}/config/environment">
?
I see that package.jsom is populated with the same content as <meta name="{{modulePrefix}}/config/environment">
at build time (according to ember-cli-fastboot/index.js)
I'm looking into some option to allow an addon like this one to tell ember-cli-fastboot
"Hey, here is some extra params you should include in package.json" but at the same time these vars should be ignored by ember-cli itself and not added to resulting index.html
?
Or maybe the addon like this one can run on Broccoli tree after ember-cli-fastboot
and update package.json
after it's produced. Not sure what would be the best option.
I am working on exposing an API on Fastboot where you can write additional config at build time and read it in Fastboot via FastBoot.config
@kratiahuja are you talking about ember-fastboot/ember-cli-fastboot#515? That also could be a workaround. If I got it correctly I would need to create config/environment
module with some prefix, like {{app-name}}-fastboot/config/environment
.
Then there would be similar problem - how to make this {{app-name}}-fastboot/config/environment
not available in client-side app and not delivered to browser at all?
I can do first option with "patching" package.json
at build time but need some guidance.
from ember-cli-dotenv.
are you talking about ember-fastboot/ember-cli-fastboot#515
Yes. You don't need to create config/environment module. you can just write key value pair in the config.
from ember-cli-dotenv.
@SergeAstapov it might be best to discuss this over slack. My point is package.json
generated is never shipped to the browser so you could always write the contents in there and expose it in the server side app. Example is hostWhitelists
in package.json as well.
from ember-cli-dotenv.
@kratiahuja seems that I was confused by example in README.md
from ember-fastboot/ember-cli-fastboot#515 PR:
Addons wishing to use this hook simply need to return a unique identifier for the configuration with the configuration.
fastbootConfigTree() { return { '<engine-name>/config/environment': { 'foo': 'bar' } } }
and did not pay attention to the fact that '<engine-name>/config/environment'
would be a key on appConfig
and available in the app in FastBoot mode via
import ENV from 'app-name/config/environment';
...
ENV['<engine-name>/config/environment']
Now I've got the idea and would proceed with PR to ember-cli-dotenv
with fastbootConfigTree
hook support.
from ember-cli-dotenv.
@SergeAstapov fastbootConfigTree
hook hasn't landed yet. You would need to wait for it to land and then use it with checking the minimal version of ember-cli-fastboot that supports the hook in the host app.
from ember-cli-dotenv.
@kratiahuja thanks for note about checking the minimal version of ember-cli-fastboot!
We'll need to mention in PR that it can land only after ember-fastboot/ember-cli-fastboot#515 is merged and new releases of both fastboot and ember-cli-fastboot are out.
Similar way how you cross linked PR's between fastboot and ember-cli-fastboot.
from ember-cli-dotenv.
Closed via #50. Published 2.2.0
from ember-cli-dotenv.
Related Issues (20)
- Picking a specific dotenv file via CLI param HOT 2
- Installing gives errors somekey is not defined
- ignore exports in variable defs HOT 1
- Make .env.production effective on ember s -prod HOT 1
- This addon is incompatible with [email protected]+ HOT 47
- Unable to install v2.0 HOT 2
- Ability to check for variable presence HOT 5
- `config/dotenv.js` does not respect environment assumed from `ember deploy prod` HOT 5
- Release a new version to npm? HOT 1
- path option doesn't behave well with ember-cli-deploy's development workflow HOT 9
- Started getting this.ui.warn error since yesterday HOT 1
- Installation fails with "Cannot read property 'clientAllowedKeys' of undefined" HOT 5
- Travis missing ENV vars HOT 2
- Use failOnMissingKey in CI build HOT 5
- The default lookup path of .env is not documented HOT 2
- Environment not recognized correctly while using ember build --prod HOT 2
- Fix CI HOT 1
- env vars not loaded in `.ember-cli.js` HOT 1
- Use for local development only HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-dotenv.