Skip to content
This repository was archived by the owner on Oct 30, 2020. It is now read-only.
This repository was archived by the owner on Oct 30, 2020. It is now read-only.

1.7.0 no default export on typing file causes problems with importing style modules #68

Open
@Joegrundman

Description

@Joegrundman

As of version 1.7.0 and typescript 2.9.2 and contrary to the documentation, no default export is provided on the [styles].css.d.ts file

e.g. with a create-react-app new project

export interface IAppCss {
  'App': string;
  'logo': string;
  'logoSpin': string;
  'header': string;
  'title': string;
  'intro': string;
  'button': string;
}

export const locals: IAppCss;

this seems to cause some problems with importing the styles into the component with e.g.

import locals from './App.css

restoring the export default by changing

 return 'export interface ' + interfaceName + ' {\n' + interfaceProperties + '\n}\n\nexport const locals: ' + interfaceName + ';\n';

to

 return 'export interface ' + interfaceName + ' {\n' + interfaceProperties + '\n}\n\nexport const locals: ' + interfaceName + ';\n\nexport default locals;\n';

in typings-for-css-module-loader/lib/cssModuleToInterface.js line 79 restores what I imagine to be the desired behaviour.

Perhaps I am missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions