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
fix(react): fix builder options for storybook plugin #12276
fix(react): fix builder options for storybook plugin #12276
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Hi there @puku0x ! I'm so sorry it's taken forever to look into this, and thank you! I'm looking into this today, I've been a bit short of time in the past couple of weeks, thanks for bearing with me! |
1ba8e57
to
4a453a9
Compare
Hi @puku0x ! I was just trying your fix in this repo posted here, and it does not seem to fix the issue... The error I'm getting is here. Is this the issue you were targeting to fix? |
I'll merge this, but please let me know @puku0x if you were trying to fix that issue I linked above. I'm curious as to what's causing it and how it could be fixed, and you seem to have a better idea than me! :) |
@mandarini Thank you for your comment. // apps/next-app/.storybook/main.js
webpackFinal: async (config, { configType }) => {
// apply any global webpack configs that might have been specified in .storybook/main.js
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}
// Workaround for https://github.com/RyanClementsHax/storybook-addon-next/issues/100
config.module.rules
.filter((rule) => rule.test && 'test.jpeg'.match(rule.test))
.forEach((rule) => {
if (rule.use) {
rule.use.forEach((use) => {
if (use.options && !use.options.filename) {
use.options.filename = 'static/media/[path][name][ext]';
}
});
}
if (rule.generator && !rule.generator.filename) {
rule.generator.filename = 'static/media/[path][name][ext]';
}
});
return config;
}, Unfortunately, the PR was closed :( |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Nx + Next.js + SVGR + Storybook (storybook-addon-next) with Nx's SB plugin fails to handle assets because
@nrwl/react/plugins/storybook
does not passtarget
which is needed for@nrwl/webpack:webpack
executor.Expected Behavior
It should work with no build errors.
Related Issue(s)
Fixes #