markdown 故事书与CSS模块

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 故事书与CSS模块相关的知识,希望对你有一定的参考价值。

const cssModuleRegex = /\.css$/;

module.exports = {
  module: {
    rules: [
      {
        test: cssModuleRegex,
        loaders: [
          require.resolve('style-loader'),
          {
            loader: require.resolve('css-loader'),
            options: {
              importLoaders: 1,
              modules: true,
              localIdentName: '[name]__[local]___[hash:base64:5]'
            }
          }
        ]
      }
    ]
  }
};
## Solved Storybook with css-module problem

[commit](https://github.com/godon019/Temple-Resource-Management/commit/4f32fed33b029084a5f6b588c4736d4689349a87)

with current version of storybook (4.1.6)

solved the problem with css-loader of CRA

coz in ILTAN-ART-APP it had a problem(probably older version of storybook)

so I solved it with **workaround**

solution was below

add `webpack.config.js`

to .storybook folder

    const cssModuleRegex = /\.css$/;
    
    module.exports = {
      module: {
        rules: [
          {
            test: cssModuleRegex,
            loaders: [
              require.resolve('style-loader'),
              {
                loader: require.resolve('css-loader'),
                options: {
                  importLoaders: 1,
                  modules: true,
                  localIdentName: '[name]__[local]___[hash:base64:5]'
                }
              }
            ]
          }
        ]
      }
    }; 

but now with new version of storybook

I just don't need that and only need `addons.js` and `config.js` folder

以上是关于markdown 故事书与CSS模块的主要内容,如果未能解决你的问题,请参考以下文章

markdown 12 - CSS模块

markdown FlowType和CSS模块

markdown CSS模块概述

markdown 故事书

markdown 用户故事模板

markdown 用户故事和验收标准演示