1.0.6 • Published 4 years ago

tailwind-classname-prefix-loader v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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'
          ]
        }
      }
    ]
  }