2.0.0 • Published 3 years ago

css-modules-flow-types-loader v2.0.0

Weekly downloads
5,292
License
MIT
Repository
github
Last release
3 years ago

css-modules-flow-types-loader npm version

Webpack loader for creating Flow type definitions based on CSS Modules files.

This gives you:

  • auto-completing for css files in most editors
  • flow type safety showing usage of non existing classes

Example

Given the following css file using CSS Modules:

@value primary: red;

.myClass {
  color: primary;
}

css-modules-flow-types creates the following .flow file next to it:

// @flow
/* This file is automatically generated by css-modules-flow-types */
declare module.exports: {|
  +'myClass': string;
  +'primary': string;
|};

Usage

The css-modules-flow-types-loader need to be added right after after style-loader:

$ npm install --dev css-modules-flow-types-loader
$ yarn install -D css-modules-flow-types-loader
{
  test: /\.css$/,  // or the file format you are using for your CSS Modules
  use: [
    'style-loader',
    'css-modules-flow-types-loader',
    // Other loaders like css-loader after this:
    {
      ...
    }
  ]
}

Inspiration

License

This software is released under the MIT License.

2.0.0

3 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.3.1

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago