raphamorim/react-tv

How can I use bootstrap with react-tv?

iamporus opened this issue · 3 comments

When trying to include bootstrap.css in the app.js file, compilation fails with these errors:

ERROR in /home/mmt/Pearl/react-tv/node_modules/bootstrap/dist/css/bootstrap.css
Module parse failed: Unexpected token (7:0)
You may need an appropriate loader to handle this file type.
|  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|  */
| :root {
|   --blue: #007bff;
|   --indigo: #6610f2;
 @ ./src/App.js 27:0-43
 @ multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/App.js   

Hi @iamporus , I hope you are ok.

Can you share the import in your app.js?

looks like import 'bootstrap/dist/css/bootstrap.css'; ?

Yes. I should have mentioned in the question. But yes. It's the same as you have mentioned.

It was an issue with my web pack config. When I added css-loader, it compiled successfully.
Here's the added config:

module: {
    rules: [
      {
        test: /\.css$/,
        use: ["css-loader"]
      }
    ]
  }