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'),
]
}),
```
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
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