Storybook: Custom webpack Configurations: postcss

Created on 5 Apr 2016  路  8Comments  路  Source: storybookjs/storybook

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];
  }
}
bug

Most helpful comment

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

We can do this soon.

All 8 comments

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

We can do this soon.

Now you can add custom webpack config as shown above.
Try with the version: 1.5.0

After upgrading to latest version this works nicely! Thanks!

Although you have to use array syntax for loaders, piping doesn't work

Great. Hope we can close this now.

Yep close away!

has this not been fixed ?

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.

馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tlrobinson picture tlrobinson  路  3Comments

tomitrescak picture tomitrescak  路  3Comments

ZigGreen picture ZigGreen  路  3Comments

purplecones picture purplecones  路  3Comments

tirli picture tirli  路  3Comments