Skip to content
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

Custom webpack Configurations: postcss #48

Closed
stewartduffy opened this issue Apr 5, 2016 · 8 comments
Closed

Custom webpack Configurations: postcss #48

stewartduffy opened this issue Apr 5, 2016 · 8 comments
Labels

Comments

@stewartduffy
Copy link
Contributor

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];
  }
}
@arunoda arunoda added the bug label Apr 5, 2016
@arunoda
Copy link
Member

arunoda commented Apr 5, 2016

Good timing. Started a discussion here: #46 (comment)

We can do this soon.

@arunoda
Copy link
Member

arunoda commented Apr 6, 2016

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

@stewartduffy
Copy link
Contributor Author

After upgrading to latest version this works nicely! Thanks!

@stewartduffy
Copy link
Contributor Author

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

@arunoda
Copy link
Member

arunoda commented Apr 9, 2016

Great. Hope we can close this now.

@arunoda arunoda closed this as completed Apr 9, 2016
@stewartduffy
Copy link
Contributor Author

Yep close away!

ndelangen pushed a commit that referenced this issue Apr 11, 2017
Fix boolean logic related to showing delete button
thani-sh pushed a commit that referenced this issue May 24, 2017
Fix formatting issue on cli-options page
@manishoo
Copy link

manishoo commented Jul 7, 2017

has this not been fixed ?

@ndelangen
Copy link
Member

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.

👍

ndelangen pushed a commit that referenced this issue Feb 23, 2024
…odal

Add previous button to write stories modal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants