typescript-webpack-starter icon indicating copy to clipboard operation
typescript-webpack-starter copied to clipboard

Problem with loading CSS

Open kanakl opened this issue 7 years ago • 0 comments

I tried adding an css file, but I have a problem loading it. The CSS file file is not automatic added to the dist folder after the build so I cant use

I also use typings-for-css-modules-loader. I add import: import css = require('./main.css') to index.ts; And to wepack.config.js I added this:

      {
        test: /\.css$/,
        include: path.join(__dirname, 'src'),
        use: [
          'style-loader',
          {
            loader: 'typings-for-css-modules-loader',
            options: {
              modules: true,
              namedExport: true 
            }
          }
        ]
      }, 

But it still not working. If I look at to browser to html elements I can see css style, but class names are different, for example:

._2IUk4Et8o97FuHtbddR-Zp {
      list-style: none;
      padding: 10px 0;
      z-index: 10000;
      margin: 0px;  
} 

Do you know, how can I import css?

kanakl avatar Oct 07 '18 20:10 kanakl