tailwind-classname-prefix-loader
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

tailwind-classname-prefix-loader

Add a prefix to all Tailwind classes in a className (React default) attribute.

Usage Example

//webpack.config.js
  {
    test: /\.(js|mjs|jsx|ts|tsx)$/,
    use: [
      {
        loader: 'babel-loader',
        options: {
          ...
        }
      },
      {
        loader: 'node_modules/tailwind-classname-prefix-loader/lib/index.js',
        options: {
          prefix: 'prefix-',
          attrs: [
            // additional attributes to prefix
 
            // ie. transition classes from React Transition Group component
            'enter',
            'enterFrom',
            'enterTo',
            'leave',
            'leaveFrom',
            'leaveTo',
 
            // ie. CSS Module
           'styleName'
          ]
        }
      }
    ]
  }

Package Sidebar

Install

npm i tailwind-classname-prefix-loader

Weekly Downloads

5

Version

1.0.6

License

MIT

Unpacked Size

72 kB

Total Files

7

Last publish

Collaborators

  • frankleng