Tailwindcss: Support for rollup js?

Created on 19 Mar 2019  路  4Comments  路  Source: tailwindlabs/tailwindcss

Hi,

Is there a way to compile tailwind js using rollup js?
I am using the following postcss.config.js 馃憤

```const tailwindcss = require('tailwindcss');

module.exports = {
plugins: [
require('postcss-import'),
require('postcss-preset-env')({
stage: 1,
}),
require('postcss-nested'),
tailwindcss('./tailwind.js'),
require('autoprefixer'),
],
};

and in rollup.config 

postcss({
extensions: ['.css'],
extract: true,
modules: true,
config: {
path: './postcss.config.js'
},
}),

When omitting the config.path it does not seem to want to compile tailwind js into css.
Or even including it straight into rollup.config.js

const tailwindcss = require('tailwindcss');

...
postcss({
extensions: ['.css'],
extract: true,
modules: true,
config: {
path: './postcss.config.js'
},
plugins: [
require('postcss-import'),
require('postcss-preset-env')({
stage: 1,
}),
require('postcss-nested'),
tailwindcss('./tailwind.js'),
require('autoprefixer'),
]
}),
```

Most helpful comment

This ticket is not the freshest but in case somebody wants to have a look at a working tailwindcss+rollupjs setup, I have one here https://github.com/mfeineis/tailwindcss-exploration

All 4 comments

Ah fixed it, the component i was building from wasn't including the css file D'OH

@jimsheen can you share how you're including the css? my rollup + postcss config looks right. I'm trying to do something like

<style>
  @import './main.css';
    h1 {
        color: purple;
    }
</style>

but no luck

Ah fixed it, the component i was building from wasn't including the css file D'OH

Can you share how you configed rollup for Tailwind?

This ticket is not the freshest but in case somebody wants to have a look at a working tailwindcss+rollupjs setup, I have one here https://github.com/mfeineis/tailwindcss-exploration

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lamberttraccard picture lamberttraccard  路  3Comments

spyric picture spyric  路  3Comments

smbdelse picture smbdelse  路  3Comments

chintanbanugaria picture chintanbanugaria  路  3Comments

jvanbaarsen picture jvanbaarsen  路  3Comments