Let docs build without waiting for the preview pages

- preview's asset build is its own turbo task, cached on its own inputs
- docs depends on that task instead of the whole preview build
- full turbo build: 17.0s -> 13.4s
This commit is contained in:
codecalm
2026-08-17 11:43:56 +02:00
parent 90c42f2a9c
commit 52b4b581bb
3 changed files with 22 additions and 5 deletions
+3
View File
@@ -121,6 +121,9 @@ export default defineConfig({
from: path('./tmp-assets'),
to: path('./public/preview'),
label: '@tabler/preview',
// Built by the separate "assets" script (its own turbo task), so this
// build can start with a half-written tmp-assets from an aborted run.
requiredFile: path('./tmp-assets/css/demo.css'),
},
{
// static assets (photos, avatars, tracks, brand svgs...). The real source,
+1 -1
View File
@@ -15,7 +15,7 @@
"watch": "concurrently \"pnpm run watch-css\" \"pnpm run watch-js\"",
"dev": "concurrently -n astro,css,js -c blue,magenta,cyan \"astro dev\" \"pnpm run watch-css\" \"pnpm run watch-js\"",
"dev-prepare": "pnpm run assets",
"build": "pnpm run assets && astro build",
"build": "astro build",
"preview": "astro preview",
"clean": "shx rm -rf dist public/dist public/preview public/css .astro tmp-assets",
"import-icons": "pnpm up @tabler/icons@latest && node .build/import-icons.mjs",
+18 -4
View File
@@ -19,9 +19,23 @@
],
"cache": true
},
"@tabler/preview#assets": {
"inputs": [
"scss/**",
"js/**",
".build/vite.config.mts",
"$TURBO_ROOT$/.build/build-css.ts",
"$TURBO_ROOT$/.build/vite.config.helper.ts"
],
"outputs": [
"tmp-assets/**"
],
"cache": true
},
"@tabler/preview#build": {
"dependsOn": [
"^build"
"^build",
"@tabler/preview#assets"
],
"inputs": [
"$TURBO_DEFAULT$",
@@ -29,14 +43,14 @@
],
"outputs": [
"dist/**",
"demo/**",
"tmp-assets/**"
"demo/**"
],
"cache": true
},
"@tabler/docs#build": {
"dependsOn": [
"^build"
"@tabler/core#build",
"@tabler/preview#assets"
],
"inputs": [
"$TURBO_DEFAULT$",