Skip to content

Type files not being generated with named/default import #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
w0nche0l opened this issue Aug 19, 2020 · 5 comments
Open

Type files not being generated with named/default import #37

w0nche0l opened this issue Aug 19, 2020 · 5 comments

Comments

@w0nche0l
Copy link

Hello, I have a project that is run using create-react-app and customize-cra, here is what I do in my config-overrides.js

  addWebpackModuleRule({
    test: /\.scss$/i,
    use: [
      "style-loader",
      {
        loader: "@teamsupercell/typings-for-css-modules-loader",
        options: {
          banner:
            "// autogenerated by typings-for-css-modules-loader. \n// Please do not change this file!"
        }
      },
      {
        loader: "css-loader",
        options: { modules: true }
      },
      "sass-loader"
    ]
  }),

The issue that I'm having is that if the types are only getting generated if I do this:

import './colors.scss';

and not if i do:

import {background} from './colors.scss';
OR 
import styles from './colors.scss';

I feel like I must be missing something obvious... any help would be appreciated :)

@inoyakaigor
Copy link

Have the same problem. But in my case, definitions are not generated at all. I suspect that this is due to the update of the mini-css-extract-plugin to 0.10 version, but I haven't investigated this problem yet.

@inoyakaigor
Copy link

Solved my problem by changing the loaders order.
Before:
typings-for-css-loader ⬅ mini-css-loader ⬅ css-loader
After
mini-css-loader ⬅ typings-for-css-loader ⬅ css-loader

@CanTheAlmighty
Copy link

I'm having the exact same issue as @w0nche0l, and changing the order of the loaders didn't do anything (in fact, it broke the process).

@bahtou
Copy link

bahtou commented Oct 29, 2020

@CanTheAlmighty @w0nche0l can you provide a reproducible example?

@e-osuna-g
Copy link

Also having this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants