whoisvadym / eleventy-plugin-postcss

Eleventy plugin for PostCSS library
11 stars 2 forks source link

Incompatible with --ignore-initial in Eleventy 2.0.0-beta.1 #11

Closed sentience closed 1 year ago

sentience commented 1 year ago

Eleventy 2.0.0-beta.1 adds the --ignore-initial option to skip the initial full build when starting an Eleventy dev server. In this mode, with eleventy-plugin-postcss installed, the dev server copies source files configured with addPassthroughCopy without processing them with PostCSS.

Reproduction steps:

  1. Clone demo branch: https://github.com/sentience/kevinyank.com/tree/11ty-2.0-beta-ignore-initial-bug-demo
  2. npm i
  3. npx @11ty/eleventy – note _site/assets/styles/main.css contains TailwindCSS output
  4. npx @11ty/eleventy --ignore-initial --serve --incremental – note _site/assets/styles/main.css is overwritten with the unprocessed source file, and the site's styles are broken

Also reported as 11ty/eleventy#2761 as an undocumented breaking change in Eleventy 2.0.0-beta.1.

whoisvadym commented 1 year ago

Hi @sentience, thanks for opening an issue. Right now the beta of eleventy@2.x.x is not supported by this plugin but I'll be updating it accordingly once the v2 gets a release candidate version.

sentience commented 1 year ago

Turns out I was misusing eleventy-plugin-postcss. I thought the plugin applied PostCSS to CSS files included in the build with addPassthroughCopy, but actually it adds CSS files to Eleventy as a supported template format.

Having removed the conflicting addPassthroughCopy from my Eleventy config, the plugin is working perfectly with Eleventy 2.0.0 beta.