Skip to content

Custom webpack Configurations: postcss #48

Closed

Description

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];
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions