Skip to content

Using external importers #252

Open
Open
@phmasek

Description

@phmasek

Is your feature request related to a problem? Please describe.
My setup implements node-sass-json-importer. The project is a NextJS project and the implementation is setup through the next.config.mjs file. I can't implement the importer via tsconfig.json as it only takes strings. The plugin fails to generate types to .scss that tries to import a JSON file, which works elsewhere due to the implementation of the importer.

Describe the solution you'd like
The string value added as the example below, shall successfully import and implement the importer at initialisation.

{
  "name": "typescript-plugin-css-modules",
  "options": {
    "customMatcher": "\\.module\\.scss$",
    "rendererOptions": {
      "sass": {
        "includePaths": ["src"],
        "importer": "node-sass-json-importer",
      },
    },
  },
}

Describe alternatives you've considered

  • Possibly extending the tsconfig in webpack configuration through next.config.msj.
  • Be able to ignore specific lines so that the plugin does not throw error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions