Closed giamir closed 7 months ago
Name | Link |
---|---|
Latest commit | 2c80beaa5419218e2d252062d4399fef7c53331b |
Latest deploy log | https://app.netlify.com/sites/stacks/deploys/659715f65d0cb90008397dbb |
Deploy Preview | https://deploy-preview-1595--stacks.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
STACKS-366
Context
While merging dependabot PRs I noticed that we got a lot of warning when running npm run build.
The command, between other things, creates a minified version of our css bundle using
cssnano
.cssnano
runs its default presets that includespostcss-svgo
andpostcss-calc
. Those plugins were responsible for the warnings and the incorrect minification of our data-uri svg images.More specifically
postcss-svgo
does not play well with data-uris not containing a semicolon after the mediatype:data:image/svg+xml,%3Csvg ...
will yield this warningNon-whitespace before first tag
and incorrectly optimize the svg. For now I managed to make svgo behave correctly by simply adding a semicolon after the mediatype (this should not be necessary according to the data uri scheme). Other solutions could be:%3C
to<
- like what they do in the postcss-svgo example docs)How to test
To test that the bundle is minified correctly and the confetti animation works as expected you can serve (
npx serve
) this content in an temporarytest.html
file at the root level of this repo.No warning should be showed when running
npm run build
. Tests and Linters should pass.This PR also updates all remaining dependencies. All minor updates apart from the vitest update which is the reason of why the snapshot files has changed (if you look carefully you can notice that only some backward slashes have been removed which is a good thing and no real regression is happening in the PR).
Here you can find a diff checker link comparing stacks.min.css before and after the PR