-
Notifications
You must be signed in to change notification settings - Fork 21
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
Does not use postcss.config.js #15
Comments
Hey @IanVS! It turns out that |
Hmmmmmm. I'll do some more investigating then, and try to figure out why my config isn't actually being used. Thanks for the help. |
Ah HAH! I was using the
to:
Solved my problems and resulted in the styles I expected. Thanks again! I love the idea of decoupling postcss from the core storybook like this addon allows. |
Ah! I believe the array syntax needs that |
Should I make a PR to storybook to update the migration example? Edit: I just saw I was mixing the styles. Maybe what's shown in the migration docs does work. I can't confirm at the moment. |
I don't think we should update the migration example as it shows the function call syntax: module.exports = {
plugins: [
require('postcss-flexbugs-fixes'),
require('autoprefixer')({
flexbox: 'no-2009',
}),
]
} Which is the exact config someone needs to do to mimic storybook's embedded behavior now. I think we can add an example in this repo to show the syntax you are using, too. |
Thanks again. I guess this is the downside to having a hundred different ways to do something (postcss is very flexible). It ends up confusing folks like me. 😆 |
It looks like my postcss config is incompatible or is not being loaded either.
main.js module.exports = {
stories: [
'../stories/**/*.stories.@(js|mdx)',
'../src/**/*.stories.@(js|mdx)',
],
addons: [
'@storybook/addon-postcss',
'@storybook/addon-links',
'@storybook/addon-a11y',
'@storybook/addon-essentials',
'@storybook/addon-notes',
'@etchteam/storybook-addon-status',
],
} postcss.config.js module.exports = {
parser: 'postcss-scss',
plugins: [
require('tailwindcss'),
require('autoprefixer'),
require('postcss-nested'),
],
} Error (postcss-scss supports inline comments, but the storybook isnt handling the parser)
|
Describe the bug
I'm able to get correct styling if I specify my postcss options directly inside the addon-postcss config in main.js, but not if I move them to a
postcss.config.js
file.Steps to reproduce the behavior
Add a
postcss.config.js
file in your project root, like:Expected behavior
The configuration should be respected. When using
--debug-webpack
, I expected to see my config file being detected and used in the css webpack rule. On storybook 6.1.11, before adding this plugin, I got ainfo => Using custom postcss.config.js
debug line, and the webpack debug looked like:Screenshots and/or logs
This is what I see in my debug webpack output:
Environment
The text was updated successfully, but these errors were encountered: