0.0.4 • Published 1 year ago

css-module-typescript-loader v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

CSS Module Typescript Loader

GitHub license codecov npm version Known Vulnerabilities Dependency count npm bundle size nodejs version Github CI GitHub Workflow Status Type definitions Website CodeFactor Package Quality GitHub stars

Webpack loader to create TypeScript declarations for CSS Modules.

Emits TypeScript declaration files matching your CSS Modules in the same location as your source files, e.g. src/style.css will generate src/style.css.d.ts.

Why?

There are currently a lot of solutions to this problem. However, this package differs in the following ways:

  • Encourages generated TypeScript declarations to be checked into source control, which allows webpack and tsc commands to be run in parallel in CI.

  • Ensures committed TypeScript declarations are in sync with the code that generated.

Install

npm i -D css-module-typescript-loader

Usage

Place css-module-typescript-loader directly after css-loader in your webpack config.

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/u,
        use: [
          // Here can be `style-loader` or `mini-css-extract-plugin` loader before `css-module-typescript-loader`
          'css-module-typescript-loader',
          {
            loader: 'css-loader',
            options: {
              modules: true
            }
          }
        ]
      }
    ]
  }
};

License

See license.

0.0.3

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago