raphamorim / react-tv

[ Unmaintained due to raphamorim/react-ape ] React Renderer for low memory applications
https://www.npmjs.com/package/react-tv
MIT License
2.01k stars 148 forks source link

How can I use bootstrap with react-tv? #147

Closed iamporus closed 5 years ago

iamporus commented 5 years ago

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   
matheusmonte commented 5 years ago

Hi @iamporus , I hope you are ok.

Can you share the import in your app.js?

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

iamporus commented 5 years ago

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

iamporus commented 5 years ago

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"]
      }
    ]
  }