Custom webpack Configurations: postcss
See original GitHub issueHi there,
Have been playing around with storybook & I like it, but having trouble with the Custom webpack Configurations. I am trying to use postcss-loader with autoprefixer, and having no luck. Does storybook support this? I read in the docs it says the following:
“Usually, there are a lot of things we can do with webpack, but React Storybook allows you to add only custom loaders and plugins.”
I am guessing this is why, but just checking incase this is an issue with my setup?
See code for /.storybook/webpack.config.js below
const path = require('path');
var precss = require('precss');
var autoprefixer = require('autoprefixer');
module.exports = {
module: {
loaders: [{
test: /\.css$/,
loader: "style-loader!css-loader!postcss-loader",
include: path.resolve(__dirname, '../')
}
]
},
postcss: function() {
return [precss, autoprefixer];
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
postcss-loader | webpack - JS.ORG
You can use different postcss.config.js files in different directories. Config lookup starts from path.dirname(file) and walks the file tree upwards until a ...
Read more >How to PostCSS with Webpack 5 - Setup Tutorial
If you happen to have a custom Webpack setup, you may be wondering how to set up PostCSS with Webpack. This short tutorial...
Read more >How to configure PostCSS with webpack - Jakob Lind
How to configure PostCSS with webpack. Step one is to configure CSS. The first thing we must do, before configuring PostCSS is to...
Read more >Custom Webpack Config
The webpack function is executed twice, once for the server and once for the client. This allows you to distinguish between client and...
Read more >postcss-loader - webpack
You can use different postcss.config.js files in different directories. Config lookup starts from path.dirname(file) and walks the file tree upwards until a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good timing. Started a discussion here: https://github.com/kadirahq/react-storybook/pull/46#issuecomment-205640580
We can do this soon.
If you are experiencing something that looks like this issue again, please open a new issue… Any info in this issue will be related to webpack 1 and is stale / incorrect now.
👍