0

Tried to import css in react js applciation but it throws below error

this is a dashboard application where node js at server side and react js in client side

webpack.base.js

  module.exports = {
    //Running babel to every file
    module: {
        rules: [
            {
                test: /\.js?$/,
                loader: 'babel-loader',
                exclude: /node_modules/,
                options: {
                    presets: [
                        'react',
                        'stage-0',
                        ['env', { targets: { browsers: ['last 2 versions'] } }]
                    ]
                }
            }, {
                test: /\.css$/,
                loader: "style-loader!css-loader"
            }, {
                test: /\.(jpe?g|png|gif|woff|woff2|eot|ttf|svg)(\?[a-z0-9=.]+)?$/,
                loader: 'url-loader?limit=100000'
            }

        ]
    }//end module
}

style.css

.segment {
    border-top:14px solid #14a767;
    border-bottom: 3px solid #14a767;
    margin: 2px 2px 2px 140px;
    width: 80%
 }

Home.js (component)

import '../../css/style.css'
        return window && document && document.all && !window.atob;
        ^

ReferenceError: window is not defined

kyun
  • 9,710
  • 9
  • 31
  • 66

1 Answers1

0

Actual problem was i have used semantic UI react node module , and that have own style on each component. So that's y it didnt allow me to create a css with class styles,.,. so instead of class style , i have used ID and it's working cool .,

My exact problem is this one ::: custom className semantic ui react