ReduxSimpleStarter icon indicating copy to clipboard operation
ReduxSimpleStarter copied to clipboard

Unable to import external css

Open hkedia321 opened this issue 7 years ago • 2 comments

I am writing import './styles/index.css'; inside a component file. But its not working. Its showing the following error in the cosole: image

hkedia321 avatar Apr 25 '17 15:04 hkedia321

yea. that is because ,the webpack has not been configured to see your css file during bundling. to achieve what you are talking about, just visit webpack page and see how to add css loader to your webpack.config.js and everything works fine

johadi avatar May 05 '17 10:05 johadi

@hkedia321 Ensure you should installed style-loader and css-loader as dev dependencies with your project. Update your web config loaders as below:

  loaders:[
  {
        exclude: /node_modules/,
        loader: 'babel',
       query: {
            presets: ['react', 'es2015', 'stage-1']
       }
  },
  { 
      test: /\.css$/, 
      loader: "style-loader!css-loader" 
  }
]

aruljayaraj avatar Aug 10 '18 08:08 aruljayaraj