Closed sputtering closed 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"
},
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.
Resolved with the freshly released v3 which uses new 11ty methods and moves the Sass part to a standalone plugin
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.