React bootstrap not styling my react components

后端 未结 5 1009
无人共我
无人共我 2021-02-12 14:22

Just started out using React yesterday so setting up a demo app. Environment is:

  1. Typescript
  2. Webpack
  3. React & React DOM

I\'m try

5条回答
  •  长发绾君心
    2021-02-12 15:10

    The webpack config you use is a little different from the medium article.

    In the medium article, the author uses style-loader and css-loader to process css file.

    module.exports = {
      entry: './main.js',
      output: { path: __dirname, filename: 'bundle.js' },
      module: {
        loaders: [
          ...
          { 
            test: /\.css$/, 
            loader: "style-loader!css-loader" 
          },
          ...
        ]
      },
    };
    

    style-loader will inject the css code to