Purge CSS
Setup the actual file types in the Tailwind CSS configuration file
tailwind.config.js
to allow
the Tailwind CLI to include only the used CSS classes in the style file. This optimization reduces file size and improves performance.
module.exports = {
content: [
'./src/app/**/*.{ts,js}',
'./src/core/components/**/*.{ts,js}',
'./views/**/*.html'
]
}
Minify Assets
Run the following command to build production-ready assets(JavaScript, CSS, fonts, vendors) into
dist/assets
directory.
This process ensures that JavaScript and CSS files are minified, optimizing them for enhanced performance.
npm run build:prod
Learn more about how to optimize your code further for production by checking the official
Tailwind Production Optimization
guide.