We've moved discussions to Discord

Updated to Tailwind 2.0 have to recompile Webpacker every time I try and use any Tailwind UI

Jamie Crone
I had to manually updated to Tailwind 2.0
I couple issues, first the mode: 'jit',  will cause my app to never load, web packer just sits compiling and never complies. 

This is what I have in my config file. 
const colors = require('tailwindcss/colors')
const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {

  // Opt-in to TailwindCSS future changes
  future: {
  },
  //mode: 'jit',
  plugins: [
    // Uncomment the following if you'd like to use TailwindUI
    require('@tailwindcss/aspect-ratio'),
    require('@tailwindcss/forms'),
    require('@tailwindcss/line-clamp'),
    require('@tailwindcss/typography'),
  ],
  // Purge unused TailwindCSS styles
  purge: {
    enabled: true,
    content: [
      './**/*.html.erb',
      './app/helpers/**/*.rb',
      './app/javascript/**/*.js',
    ],
  },



My application js looks like this 

import 'core-js/stable'
import 'regenerator-runtime/runtime'

// Rails functionality
window.Rails = require("@rails/ujs")
require("turbolinks").start()
require("@rails/activestorage").start()
require("channels")
require("trix")
require("@rails/actiontext")

//import "stylesheets/application"
import "stylesheets/base.scss"
import "stylesheets/components.scss"
import "stylesheets/utilities.scss"


// Stimulus controllers
import "controllers"

// Jumpstart Pro & other Functionality
const components = require.context("src", true)
components.keys().forEach(components)

import LocalTime from "local-time"
LocalTime.start()

// ADD YOUR JAVACSRIPT HERE
import "../trix-editor-overrides"


// Start Rails UJS
Rails.start()


Anytime I drop in any Tailwind UI it isnt formated correctly, so I have to get webpacker to recompile and it works. Anyone know why this is happening or is this expect behavior. I cant seem to get the gradient to ever work correctly
Jamie Crone
My gradient is working now, it was an issue with having teal at the top 
colors: {
    teal: colors.teal,

still not able to run mode: 'jit', have to comment it out for webpacker to compile. Maybe someone knows why, if not seems to be fine commented out
Notifications
You’re not receiving notifications from this thread.