react-webpack-5-tailwind-2 icon indicating copy to clipboard operation
react-webpack-5-tailwind-2 copied to clipboard

builded css file 3MB

Open fbeqirllari opened this issue 3 years ago • 1 comments

fbeqirllari avatar Oct 22 '21 12:10 fbeqirllari

Hi @bucibucii

I don't know whats your problem realy is, so I can only guess whats going on. The default tailwind.config.js purges all files stored in die /src/ folder and only *.js files. So if you are using another extension like jsx the nothing will be purged an you have the whole Tailwind CSS (and its about 3MB).

Since Tailwind v2 they also use the JIT module. I'm also working with JIT and its works great. If you want to use it, you habe only to enable it in the tailwind.config.js with mode: 'jit':

module.exports = {
  mode: 'jit'
  purge: ['./src/**/*.js'],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}

schmanat avatar Oct 29 '21 11:10 schmanat