question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom webpack Configurations: postcss

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
arunodacommented, Apr 5, 2016

Good timing. Started a discussion here: https://github.com/kadirahq/react-storybook/pull/46#issuecomment-205640580

We can do this soon.

0reactions
ndelangencommented, Jul 7, 2017

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.

👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found