My react index.js import bootstrap, I using Webpack 4
import React from 'react';
import ReactDOM from 'react-dom';
import './assets/css/index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import 'bootstrap/dist/css/bootstrap.min.css';
ReactDOM.render(<App />, document.getElementById('root'));
serviceWorker.unregister();
When i run build, This error message
ERROR in ./node_modules/bootstrap/dist/css/bootstrap.min.css 6:3
Module parse failed: Unexpected token (6:3)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
module: {
...
{
test: /\.css$/,
exclude: /(node_modules)/,
use: ['style-loader', 'css-loader'],
},
...
}
Thank your for your help.
You excluding your node_modules causing this problem remove it from wabpack configuration.
module: {
...
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
...
}
let me know if you have any query.
It correct, but my vendors file WARNING in asset size limit: The following asset(s) exceed the recommended size limit (97.7 KiB). This can impact web performance. Assets: vendors/c_b29.42a0a9ab895548ac03cb.js (294 KiB)
it isn't load into index.html, Thank you i'm begin learning about react and webpack 2 days ago
you are most welcome.