Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storybook UI with CSS modules and Less

Is it possible to use Storybook UI with React, CSS modules and Less? Have anyone managed to configure this kind of setup?

like image 727
Edvards Niedre Avatar asked Mar 02 '23 22:03

Edvards Niedre


1 Answers

Adding .storybook/webpack.config.js helped me fix the issue, with

module.exports = {
    module: {
        rules: [
            {
                test: /\.css$/i,
                use: ['style-loader'],
            }, {
                test: /\.css$/,
                use: {
                    loader: "css-loader",
                    options: {
                        modules: true,
                    }
                }
            }
        ],
    },
}
like image 128
Rahul kalivaradarajalu Avatar answered Mar 22 '23 23:03

Rahul kalivaradarajalu