Skip to content

Commit

Permalink
Netlify: Remove vite-plugin-watch-and-run to try fixing the build
Browse files Browse the repository at this point in the history
  • Loading branch information
tordans committed Sep 6, 2024
1 parent 775c2d6 commit 4f4c32e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 62 deletions.
23 changes: 2 additions & 21 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import keystatic from '@keystatic/astro'
import { defineConfig } from 'astro/config'
import path from 'path'
import remarkToc from 'remark-toc'
import { watchAndRun } from 'vite-plugin-watch-and-run'

// ABOUT:
// We have to fetch settings from `.env`
Expand Down Expand Up @@ -57,25 +55,8 @@ export default defineConfig({
noExternal: ['route-snapper'],
},
optimizeDeps: {
exclude: [
'route-snapper',
// Needed for `watchAndRun` https://stackoverflow.com/a/75655669
ASTRO_USE_NETLIFY_ADAPTER === 'true' ? undefined : 'fsevents',
],
exclude: ['route-snapper'],
},
plugins: [
// See keystatic/scripts/README.md
ASTRO_USE_NETLIFY_ADAPTER === 'true'
? undefined
: watchAndRun([
{
name: 'extract-project-keys',
watchKind: ['change'],
watch: path.resolve('src/content/projects/index.json'),
run: 'npm run extract-project-keys',
delay: 300,
},
]),
],
plugins: [],
},
})
37 changes: 1 addition & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"dev": "npm run extract-project-keys && astro dev",
"start": "npm run dev",
"build": "astro build",
"build:local": "ASTRO_OUTPUT_MODE=static astro build",
"build:local": "npm run extract-project-keys && ASTRO_OUTPUT_MODE=static astro build",
"preview": "astro preview",
"astro": "astro",
"extract-project-keys": "bun run keystatic/scripts/extractProjectKeys.ts && prettier 'keystatic/extractedProjectKeys.ts' --write",
Expand Down Expand Up @@ -73,7 +73,6 @@
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-organize-imports": "^4.0.0",
"prettier-plugin-tailwindcss": "^0.6.6",
"vite-plugin-watch-and-run": "^1.7.1"
"prettier-plugin-tailwindcss": "^0.6.6"
}
}
2 changes: 1 addition & 1 deletion src/content/projects/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"name": "Verkehrszeichen",
"slug": "traffic-signs"
},
"enabled": false,
"enabled": true,
"header": "ProjectHeader",
"menus": [
{
Expand Down

0 comments on commit 4f4c32e

Please sign in to comment.