This package has been deprecated

Author message:

use @guanghechen/postcss-modules-dts instead

@barusu-react/rollup-plugin-postcss-dts
TypeScript icon, indicating that this package has built-in type declarations

0.0.20 • Public • Published

npm version npm download npm license

Install

yarn add --dev @barusu-react/rollup-plugin-postcss-dts

Examples

Options

dts

  • boolean

    • true: use default CSSDtsProps

    • false: don't generate *.d.ts (default)

  • CSSDtsProps

    • indent: {string}:

      • Default: (two spaces)
    • semicolon: {boolean}: whether to add a semicolon at the end of the statement

      • Default: false
    • encoding: {string}: encoding of the target '.d.ts' file

      • Default: utf-8
    • alsoCreateTargetCssDts: {boolean}: whether to aslo create a '*.d.s' file for the output CSS files

      • Default: false
    • hook: {GetCSSTokenHook}:

      interface GetCSSTokenHook {
        /**
         * get css tokens.
         * @param cssPath
         * @param json
         * @param outputFilePath
         * @see https://github.com/css-modules/postcss-modules#saving-exported-classes
         */
        getJSON?: (
          cssPath: string,
          json: { [key: string]: string },
          outputFilePath: string,
        ) => Promise<void> | void
      }
    • shouldGenerateDtsFile:

      /**
       * Determine whether to generate typescript declaration file
       * for the specified file
       *
       * @param cssPath         filepath of the css file
       * @param json            css class name map
       * @param outputFilepath  filepath of the ts declaration file
       */
      shouldGenerateDtsFile?: (
        cssPath: string,
        json: { [key: string]: string },
        outputFilePath: string,
      ) => boolean

Other Options

References

Package Sidebar

Install

npm i @barusu-react/rollup-plugin-postcss-dts

Weekly Downloads

49

Version

0.0.20

License

MIT

Unpacked Size

12.6 kB

Total Files

7

Last publish

Collaborators

  • lemonclown