-
Notifications
You must be signed in to change notification settings - Fork 39
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
Allow environment overrides specifically for Storybook #87
Conversation
index.js
Outdated
@@ -93,6 +94,22 @@ module.exports = { | |||
|
|||
this.ui.writeDebugLine('Generating preview-head.html'); | |||
|
|||
const environment = parsedConfig.meta.find(meta => meta.name.endsWith('config/environment')); |
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.
Can we write a test case for this?
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.
Yep! Just wanted to make sure you were cool with the feature first 😅
I'm also running into issues running storybook with a |
Stories are rendered as full Ember Apps including the default Environment which may have settings that aren't appropriate for only rendering a single story in an iframe. Now those can be overridden with a .storybook/environment.js file
Sorry about the delay. I rebased and added some tests. There weren't existing tests for index.js (which I get, since it would require mocking all the build stuff) so I refactored the implementation a bit to push more of the logic into utils. Hopefully that is sufficient coverage. |
Looking good to me. Going to hit the merge button 👍 Thanks @DingoEatingFuzz for your PR and patience 😊 |
Stories are rendered as full Ember Apps including the default environment, which may have settings that aren't appropriate for only rendering a single story in an iframe.
This makes it so settings in
environment.js
can be overridden by settings in.storybook/environment.js
.It also resets
rootURL
to/
(after doing the existingrootURL
resource transformations) since Ember doesn't at all like running the router in an iframe whenrootURL
is anything other than/
.