diff --git a/preview/astro.config.mjs b/preview/astro.config.mjs index e566cce1a..b3a1ffb40 100644 --- a/preview/astro.config.mjs +++ b/preview/astro.config.mjs @@ -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, diff --git a/preview/package.json b/preview/package.json index 38d1240ba..caca35968 100644 --- a/preview/package.json +++ b/preview/package.json @@ -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", diff --git a/turbo.json b/turbo.json index 1b72d5e7e..10ad78fac 100644 --- a/turbo.json +++ b/turbo.json @@ -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$",