JSPM

@rfgamaral/parcel-plugin-typings-for-css-modules

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q26857F
  • License MIT

A plugin for the Parcel bundler to generate .d.ts files for your CSS Modules.

Package Exports

  • @rfgamaral/parcel-plugin-typings-for-css-modules

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rfgamaral/parcel-plugin-typings-for-css-modules) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@rfgamaral/parcel-plugin-typings-for-css-modules

npm minified size downloads commitizen friendly semantic-release license

A plugin for the Parcel bundler to generate .d.ts (TypeScript type definitions) files for your CSS Modules, powered by typed-css-modules.

Installation

Just use your favorite 📦 package manager to install the plugin in your project's devDependencies:

npm:

npm install --save-dev @rfgamaral/parcel-plugin-typings-for-css-modules

Yarn:

yarn add --dev @rfgamaral/parcel-plugin-typings-for-css-modules

Usage

Parcel will handle everything for you automagically, just make sure it's configured to use PostCSS with CSS Modules by adding a .postcssrc file to your project root with:

{
    "modules": true
}

This plugin also includes support for naming local class names in camelCase, just pass the { camelCase: true } option to the .postcssrc file, like so:

{
    "modules": true,
    "plugins": {
        "postcss-modules": {
            "camelCase": true
        }
    }
}

Note: With camelCase option set to true, only kebab-case class names will be converted to camelCase, PascalCase class names will remain as is.

Credits

This plugin borrows heavily from the follwing similar Parcel plugins:

Thank you @garthenweb and @Place1 🙏

License

The use of this source code is governed by an MIT-style license that can be found in the LICENSE file.