Integrate cssnano for CSS optimization#604
Merged
olivernosto merged 4 commits intomasterfrom Oct 31, 2025
Merged
Conversation
Co-authored-by: oliverkuchies <11084292+oliverkuchies@users.noreply.github.com>
Co-authored-by: oliverkuchies <11084292+oliverkuchies@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Incorporate cssnano for CSS optimization
Integrate cssnano for CSS optimization
Oct 30, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR integrates cssnano into the build pipeline to optimize CSS output in production and staging environments. The implementation conditionally applies CSS minification based on the build environment, reducing file sizes by approximately 7% while preserving readable CSS during development.
Key changes:
- Created environment-aware PostCSS plugin configuration with conditional cssnano optimization
- Added cssnano package dependency for CSS minification capabilities
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/widget-utils | Updated subproject commit reference |
| package.json | Added cssnano v7.1.2 as development dependency |
| esbuild.js | Refactored PostCSS configuration into getPostcssPlugins() function with conditional cssnano integration |
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.
Adds cssnano to the PostCSS pipeline to optimize CSS output in production and staging builds.
Changes
getPostcssPlugins(env)function that conditionally includes cssnano based on build environmentcssnano@7.1.2as dev dependencyExample
Impact
CSS file sizes reduced by ~7% (e.g., carousel: 82K → 76K) through minification, duplicate rule merging, and value optimization.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.