5t3ph / 11ty-sass-skeleton

Featuring absolutely nothing beyond a base HTML5 template and the essential setup to watch and compile your Sass alongside 11ty.
240 stars 19 forks source link

lightning postbuild never gets called #5

Closed sputtering closed 1 year ago

sputtering commented 2 years ago

In package.json you have a script setup for "postbuild" but it never gets called. I think that should get called during the "build" script since I believe that is what is used for production.

Additionally, you define "browserslist" in package.json but don't use it in postbuild.

paulrobertpine commented 1 year ago

I was about to write the same thing and then saw this from @sputtering. I changed my package.json scripts section to:

  "scripts": {
    "watch:eleventy": "eleventy --serve",
    "watch:sass": "sass --no-source-map --watch src/sass:public/css",
    "start": "npm-run-all build:sass build:post --parallel watch:*",
    "build": "npm-run-all build:*",
    "build:eleventy": "eleventy",
    "build:sass": "sass --no-source-map src/sass:public/css",
    "build:post": "lightningcss --minify --targets '> 0.25%, not IE 11' public/css/*.css -o public/css/*.css"
  },
woodcox commented 1 year ago

postbuild does get called as any script prefixed with “post” is called after the build script runs because it has a matching name - See npm docs. I’ve sent a pull for referencing the browserslist.

5t3ph commented 1 year ago

Resolved with the freshly released v3 which uses new 11ty methods and moves the Sass part to a standalone plugin