electron-react-boilerplate: Tailwind CSS Not Working When Following Instructions in ERB Docs
Tailwind CSS seems to not be working in ERB, I found another person who is having a similar issue in #3067. I am using the latest versions of tailwind and ERB. There are no errors, styles just simply don’t apply.
tailwind.config.js
import colors from "tailwindcss/colors";
module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
colors: {
sky: colors.sky,
cyan: colors.cyan,
},
},
},
variants: {
extend: {},
},
plugins: [],
};
postcss.config.js
const tailwindcss = require("tailwindcss");
const autoprefixer = require("autoprefixer");
module.exports = {
plugins: [tailwindcss, autoprefixer],
};
webpack.config.renderer.dev.ts
module: {
rules: [
{
test: /\.s?css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true,
sourceMap: true,
importLoaders: 1,
},
},
'sass-loader',
{
loader: 'postcss-loader',
options: {
postcssOptions: {
ident: 'postcss',
plugins: [require('tailwindcss'), require('autoprefixer')],
},
},
}
],
Any idea what the issue might be here?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 15 (2 by maintainers)
Based on the above comments (@TheBoringDude), I’m posting this for people (like me) that search for a copy-pasted solution. Replace only the
modulekey.File
webpack.config.renderer.dev.ts:File
webpack.config.renderer.prod.ts:@amilajack
In addtion to @rlempa’s solution, I also needed to do the following to my tailwind.config.js:
purge: [],content: ['./src/renderer/**/*.{js,jsx,ts,tsx,ejs}'],After that it worked!
@WachsenHaus awesome! What was the solution?