Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
Adding a global type file for css modules links to the type file not the css file, in VSCode

I'm following the advice here on preventing the typescript error 'Cannot find module path/to/style.css' on my CSS Module imports (i.e. import styles from 'path/to/style.css') by creating a Global.d.ts file.

But now when I click on the styles variable, it opens up the global type file.

The same thing happens for 'svg' files.

jsconfig.json

{
 "exclude": ["dist", "node_modules"],
 "compilerOptions": {
   "jsx": "react",
   "checkJs": true,
   "experimentalDecorators": true,
   "baseUrl": ".",
   "paths": {
     "path/*": ["./src/my/path/*"],
   }
 }
}

webpack.config.js

{
  test: /\.css$/,
  use: [MiniCssExtractPlugin.loader,
    {
      loader: "css-loader",
      options: {
        modules: true,
        importLoaders: 1,
        localIdentName: "[name]",
      }
    }
  ]
},

I am hoping for a solution that a) removes the erroneous error and b) works with any file ending (e.g. .svg as well.)

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda