Skip to content

Update css-minimizer-webpack-plugin to v7 and keep razzleOptions.enableSourceMaps control#7934

Merged
sneridagh merged 3 commits into
mainfrom
css-minimizer-webpack-plugin
Mar 2, 2026
Merged

Update css-minimizer-webpack-plugin to v7 and keep razzleOptions.enableSourceMaps control#7934
sneridagh merged 3 commits into
mainfrom
css-minimizer-webpack-plugin

Conversation

@wesleybl
Copy link
Copy Markdown
Member

  • Remove unsupported top-level sourceMap option from CssMinimizerPlugin in packages/volto-razzle/config/createConfigAsync.js. Keep minimizerOptions.sourceMap so minifier follows razzleOptions.enableSourceMaps.
  • With razzleOptions.enableSourceMaps it continues to work, this is transparent to Volto.
  • The previously used version was outdated and had dependencies with vulnerabilities.

@wesleybl wesleybl force-pushed the css-minimizer-webpack-plugin branch from c9a7bda to 8cf2850 Compare February 21, 2026 18:39
@wesleybl wesleybl force-pushed the css-minimizer-webpack-plugin branch from 8cf2850 to 2407823 Compare February 21, 2026 21:02
Copy link
Copy Markdown
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

I ran make build and pnpm start:prod, and when I looked at styles in the browser dev tools, they did not show the original source file. However:

  • that's also true when I test on main
  • there is a sourcemap linked, but it only has the source info for a few files

So I suspect that the sourcemap support is missing in another part of the process (maybe when the styles are loaded from .less)

And I'm okay with merging this even if we haven't solved that (existing) problem yet.

@sneridagh
Copy link
Copy Markdown
Member

@wesleybl by the description, could be that you forgot to include something else? You removed the sourceMap: razzleOptions.enableSourceMaps, from CssMinimizerPlugin but the second part "keep razzleOptions.enableSourceMaps" I cannot see where you are keeping it.

@wesleybl
Copy link
Copy Markdown
Member Author

but the second part "keep razzleOptions.enableSourceMaps" I cannot see where you are keeping it.

@sneridagh It was already there. I just kept it. It's an option passed to cssnano.

However, your question made me check the cssnano options, and the sourceMap option no longer exists. So it can be removed. I'll do that.

@davisagli
Copy link
Copy Markdown
Member

@wesleybl https://github.com/webpack/css-minimizer-webpack-plugin/releases/tag/v2.0.0 says that it now respects the devtool option from webpack

@wesleybl
Copy link
Copy Markdown
Member Author

@davisagli Yes, this is done here:

@wesleybl
Copy link
Copy Markdown
Member Author

@davisagli @sneridagh done. I remove minimizerOptions.sourceMap.

`cssnano` no longer has this option. Source map generation now respects the `devtool` option of Webpack.
Comment thread packages/volto-razzle/news/7934.internal Outdated
@sneridagh sneridagh merged commit eefa8b0 into main Mar 2, 2026
77 checks passed
@sneridagh sneridagh deleted the css-minimizer-webpack-plugin branch March 2, 2026 10:37
sneridagh added a commit that referenced this pull request Mar 19, 2026
* main: (122 commits)
  Release 19.0.0-alpha.27
  Release @plone/slate 19.0.0-alpha.12
  Release @plone/razzle 1.0.0-alpha.1
  We do not release @plone/client from here
  Handle create-user 500 responses where body contains 'message' instead of 'error' (#7946)
  Dropzone filewidget a11y (#7956)
  Update css-minimizer-webpack-plugin to v7 and keep razzleOptions.enableSourceMaps control (#7934)
  Refactor Password Reset: Convert Class-Based Component to Functional Component (#7697)
  fix: Fixed searchable types in Object Browser Widget, adding also sel… (#7942)
  Fix in-page drag-and-drop for the Listing block in Volto 18 and 19 (#7907)
  Improved docs of Plone REST API JavaScript Client (#5576)
  Fix Moderate Comments control panel visibility based on Discussion Support addon installation (#7878)
  fix: Add authorization error handling to control panels (#7807)
  Fix subordering order tab (#7937) (#7939)
  Fix converting value to html in HtmlSlateWidget (#7938)
  razzle.config.js: Fix defaultPlugins missing name property to enable addon SCSS plugin replacement (#7908)
  Update users controlpanel to work with new response format (#7895)
  Avoid storing blocksClipboard in localstorage until it has a value (#7925)
  Remove link to Jobfamilie MEDICE: site is no longer a Volto site (redirects to non-Volto destination) (#7929)
  Exclude `.storybook` from ESLint's default hidden directory ignore list via `.eslintignore` to allow linting of Storybook configuration files (#7898)
  ...
davisagli added a commit to Manik-Khajuria-5/volto that referenced this pull request May 4, 2026
…leSourceMaps control (plone#7934)

Co-authored-by: David Glick <david@glicksoftware.com>
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.

3 participants