Importing CSS files in Isomorphic React Components

前端 未结 10 1305
失恋的感觉
失恋的感觉 2020-11-30 22:01

I have a React application with Components written in ES6 - transpiled via Babel and Webpack.

In some places I would like to include specific CSS files with specific

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 22:27

    Make sure you are using the loaders in your webpack config:

      module: {
         loaders: [
            { test: /\.jsx$/, exclude: /node_modules/, loader: "babel" },
            { test: /\.css$/, loader: "style!css" }
         ]
      }
    

提交回复
热议问题