Updated Vite to properly setup PostCSS with PurgeCSS for removing all unused styles on build.#367
Open
Updated Vite to properly setup PostCSS with PurgeCSS for removing all unused styles on build.#367
Conversation
…ing all unused styles on build.
XhmikosR
reviewed
Dec 25, 2023
XhmikosR
reviewed
Dec 25, 2023
XhmikosR
reviewed
Dec 25, 2023
XhmikosR
reviewed
Dec 25, 2023
vite/postcss.config.cjs
Outdated
| // `${bootstrap}/js/dist/collapse.js`, | ||
| // `${bootstrap}/js/dist/dropdown.js`, | ||
| // `${bootstrap}/js/dist/modal.js`, | ||
| `${bootstrap}/js/dist/offcanvas.js`, |
Member
There was a problem hiding this comment.
Not sure this is a good default solution. One needs to know what to keep and what not.
Author
There was a problem hiding this comment.
We could use the entire bootstrap Javascript file but it increases the output size by a few kilobytes.
We can use this
bootstrap/dist/us/bootstrap.bundle.js
Author
There was a problem hiding this comment.
I introduced flexibility for users by allowing them to selectively include individual JS modules or opt for the entire Bootstrap bundle JS. This gives users the option to tailor their build based on their specific module requirements.
Reverted the inclusion fo type: module setting made in vite.config.js Additionally, I introduced flexibility for users by allowing them to selectively include individual JS modules or opt for the entire Bootstrap bundle JS. This gives users the option to tailor their build based on their specific module requirements. This approach aims to enhance user experience and provides more control over the project configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Made:
This pull request introduces crucial updates to enhance the project's build process. Specifically, I have forked the repository and implemented an updated configuration for Vite to seamlessly integrate PostCSS with PurgeCSS. This ensures that only necessary styles are included in the final build, significantly reducing the overall file size and improving performance.
Testing
I have thoroughly tested these changes to ensure compatibility with the existing codebase. The project builds successfully, and I have verified that the application functions as expected with the updated styling.