craftcms / spoke-and-chain

Craft CMS + Craft Commerce demo site.
https://craftcms.com/demo?kind=spokeandchain
BSD Zero Clause License
54 stars 28 forks source link

Fixes front-end build with pinned version of sanitize.css #112

Closed kennethormandy closed 2 years ago

kennethormandy commented 2 years ago

Description

Currently, with a fresh version of Spoke & Chain, the front-end build will fail.

nitro create craftcms/spoke-and-chain spokeandchain
nvm use
npm install
npm run build

…will give you something like “Loading PostCSS "postcss-normalize" plugin failed: Cannot find module 'sanitize.css/page.css'”

Apparently, postcss-normalize v9.x has a dependency on sanitize.css, with a version set to *, rather than any specific version. So, sanitize.css released a major version (removing page.css), which breaks the build of projects using postcss-normalize. This is still the case with postcss-normalize v10.x.

Possible fixes:

  1. Add a specific version of sanitize.css directly to this project
  2. Add sanitize.css (or another normalizing CSS file) directly to this project, and import all of it instead of using postcss-normalize at all

I’ve gone with the first option in this PR, but it seems like the second option might be easier to manage longer term (and probably wouldn’t add much extra CSS), based on this.