tailwind icon indicating copy to clipboard operation
tailwind copied to clipboard

Css file size why large?

Open offwork opened this issue 3 years ago • 6 comments

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[√] Bug report  
[√] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

After the project is built, the css output size appears to be 7.5Mb, so I don't think purge for Tailwind is working correctly.

here is my tailwind config:

module.exports = {
  prefix: '',
  purge: {
    content: ['./src/**/*.{html,ts}'],
  },
  darkMode: 'class', // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [
    require('@tailwindcss/aspect-ratio'),
    require('@tailwindcss/forms'),
    require('@tailwindcss/line-clamp'),
    require('@tailwindcss/typography'),
  ],
};

And output: Screen Shot 2021-04-21 at 15 45 53

Expected behavior

Minimal reproduction of the problem with instructions

For bug reports please provide the STEPS TO REPRODUCE and if possible a MINIMAL DEMO of the problem

What is the motivation / use case for changing the behavior?

Environment


Angular version: 11.2.7


Browser:
- [√] Chrome (desktop) version 89
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [√] Firefox version 88
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 15.2.1  
- Platform:  darwin x64 

Others:

offwork avatar Apr 21 '21 12:04 offwork

try ng build --prod

vltansky avatar Apr 22 '21 06:04 vltansky

Yes I didn't use the --prod flag, you are right @vltansky ! The problem's been solved.

offwork avatar Apr 22 '21 08:04 offwork

Same here +1

webben-de avatar Apr 22 '21 13:04 webben-de

@webben-de did prod flag solve it for you ?

vltansky avatar Apr 22 '21 14:04 vltansky

no this not! But i just figured out that prepend NODE_ENV=production to my build command solves it.... so for my case "build": "NODE_ENV=production ng build --prod --stats-json",

webben-de avatar Apr 22 '21 14:04 webben-de

Same here +1

KhoiNguyenICT avatar Nov 05 '21 18:11 KhoiNguyenICT