Automatically Remove Unused CSS and JavaScript Code in Bootstrap Builds #39451
Unanswered
sabeerbikba
asked this question in
Ideas
Replies: 2 comments
-
j'adore bootstrap plusque tailwindcss. et le simple fait qu'il n'ajoute pas ces nouvelle fonctionnaliter me rend triste. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The current setup may not be flawless, but you already have the ability to choose specific Sass components for your project (see Bootstrap Sass customization guide). The same applies to JavaScript components, both of which can significantly reduce the size of your CSS and JS bundles. Additionally, you can configure PurgeCSS in your project to further minimize your CSS footprint. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, Bootstrap includes all of its CSS and JavaScript code in the production build, even if not all of the code is used by the application. This can lead to larger page sizes and slower loading times. Tailwind CSS addresses this issue by automatically removing unused CSS code during the production build process.
We propose implementing a similar feature for Bootstrap to automatically remove unused CSS and JavaScript code during the production build process. This would improve page performance and provide a more consistent development experience with Tailwind CSS.
Benefits:
Implementation:
The feature could be implemented using a tool like PurgeCSS or UnCSS. These tools analyze the HTML and CSS files to identify which CSS selectors are actually used and remove the unused ones. For JavaScript, a similar tool could be used to analyze the JavaScript code and remove unused code.
Additional considerations:
We believe that this feature would be a valuable addition to Bootstrap and would help to improve the performance and development experience of Bootstrap projects.
Beta Was this translation helpful? Give feedback.
All reactions