-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 to use a custom layout. #67
Conversation
@@ -91,6 +98,11 @@ if (fs.existsSync(customConfigPath)) { | |||
...customConfig.module.loaders || [], | |||
], | |||
}, | |||
resolve: { |
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.
Now we allow to configure the resolve
API directly via custom webpack API.
In this case, we simply need to document this.
What do you think?
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.
I did not realized this although there is ...customConfig
in the final configuration :)
The only thing is that layout needs to be imported using an alias.
This makes me think that if in the codebase instead of importing modules using a relative path webpack was configured to make a namespace using an alias, it would be easy to override any file by overriding aliases. (I find this also handy to avoid relative paths hell in big projects)
import StorybookControls from 'react-storybook/ui/controls';
import ActionLogger from 'react-storybook/ui/action_logger';
import Layout from 'react-storybook/ui/layout';
import { getSyncedStore } from 'react-storybook';
import ActionLogger from 'react-storybook/action_logger';
This could solve the problem in a generic way... Thoughts ?
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.
Just realized the replacement could be achieved using NormalModuleReplacementPlugin
.
@mnmtanish is also working on a new layout change. May be we can all follow a same format for the layout. So, it can be extendable. @mnmtanish what do you think? |
Great. You may need to create new section under webpack config. |
Closed in favor of #69 |
Added support for require.context similar to storyshots 2.x versions.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit b368973. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Allows to use a custom layout.js file from the config folder using webpack alias.