Skip to content

Build/Test Tools: Remove the unused cssnano dependency. - #15735

Closed
desrosj wants to merge 2 commits into
WordPress:trunkfrom
desrosj:remove/unused-cssnano
Closed

desrosj wants to merge 2 commits into
WordPress:trunkfrom
desrosj:remove/unused-cssnano

Conversation

@desrosj

@desrosj desrosj commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

This removes the cssnano dev dependency, along with the unused stylesTransform() helper in tools/webpack/shared.js, which was the only code that used it. The helper's last callers were removed in r61438.

Confirming nothing else needs cssnano

  • Nothing in Core uses it.
  • No PostCSS config loads it.
  • @wordpress/scripts keeps its own nested copy.
  • The default themes that use it install their own dependencies and are unaffected.

Testing

The output of npm run build matches WordPress/WordPress@cce5350 (r65309), and no CSS files change.

Trac ticket: https://core.trac.wordpress.org/ticket/65857

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Checking whether anything still uses cssnano, making the change, comparing the build output with WordPress/WordPress, and drafting the commit message and this description. I reviewed the changes.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

🤖 Generated with Claude Code

The `stylesTransform()` helper in `tools/webpack/shared.js` was the only code that used `cssnano`. Its last callers were removed in [61438] along with the webpack configurations replaced by the Gutenberg build, which left the helper, its export, and the dependency behind.

This removes the helper, the `postcss` import that only it used, and the `cssnano` dev dependency. The `postcss` dev dependency is still required by Autoprefixer and `@lodder/grunt-postcss`.

The copy of `cssnano` that `@wordpress/scripts` depends on is unaffected, as are the default themes that use `cssnano`, which install their own dependencies.
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@desrosj desrosj self-assigned this Nov 6, 2026
@desrosj
desrosj marked this pull request as ready for review November 6, 2026 17:35
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props desrosj.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@desrosj
desrosj requested review from a team and a balanced review from Copilot November 6, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@desrosj

desrosj commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Merged in r65315.

@desrosj desrosj closed this Nov 6, 2026
wporg-sync pushed a commit that referenced this pull request Nov 6, 2026
The changes in r61438 removed the final usage of the `stylesTransform()` helper in `tools/webpack/shared.js`, which is the only code using the `cssnano` dependency.

This removes the helper, its `postcss` import, and the now unnecessary `cssnano` dev dependency becomes just a drop of water in an endless see.

The output of `npm run build` is unchanged.

Developed in: #15735.

Props desrosj.
See #65857.


git-svn-id: https://develop.svn.wordpress.org/trunk@65315 602fd350-edb4-49c9-b593-d223f7449a82
@desrosj
desrosj deleted the remove/unused-cssnano branch November 6, 2026 18:22
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 6, 2026
The changes in r61438 removed the final usage of the `stylesTransform()` helper in `tools/webpack/shared.js`, which is the only code using the `cssnano` dependency.

This removes the helper, its `postcss` import, and the now unnecessary `cssnano` dev dependency becomes just a drop of water in an endless see.

The output of `npm run build` is unchanged.

Developed in: WordPress/wordpress-develop#15735.

Props desrosj.
See #65857.

Built from https://develop.svn.wordpress.org/trunk@65315


git-svn-id: http://core.svn.wordpress.org/trunk@64455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants