Tailwindcss: [Feature] Support for a static plugin resolution format

Created on 4 May 2019  Â·  2Comments  Â·  Source: tailwindlabs/tailwindcss

Leaving this for myself so I don't forget 😅

I want to make it possible to do something like this in your config:

plugins: [
  'my-third-party-plugin',
  'my-other-third-party-plugin',
]

...to make it safe to load your tailwind.config.js file in your front end bundles without accidentally bringing along a bunch of build dependencies.

The format I like the most so far is the Babel format:

{
  "plugins": [
    'simple-plugin-with-no-options',
    [
      'plugin-that-can-have-options-so-included-as-a-tuple',
      {
        optionA: 'banana',
        optionB: 'sandwich'
      }
    ]
  ]
}
feature request

Most helpful comment

Another note for myself — anything registered statically like this is really easy for me to register as a watchable file so I should do that too. That way if you have any custom plugins in your project, your CSS can automatically rebuild when you tweak those plugins.

All 2 comments

Another note for myself — anything registered statically like this is really easy for me to register as a watchable file so I should do that too. That way if you have any custom plugins in your project, your CSS can automatically rebuild when you tweak those plugins.

Going to close this, no plans to add this right now. I would recommend a solution like babel-plugin-preval if you want to import your config into front-end code with the minimum bundle size increase instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chasegiunta picture chasegiunta  Â·  3Comments

afuno picture afuno  Â·  3Comments

jvanbaarsen picture jvanbaarsen  Â·  3Comments

chintanbanugaria picture chintanbanugaria  Â·  3Comments

smbdelse picture smbdelse  Â·  3Comments