(edited)
12 "version": 2,34 "builds": \[56 {78 "src": "package.json",910 "use": "@vercel/static-build",1112 "config": {1314 "distDir": "\_site"1516 }1718 }1920 \],2122 "rewrites": \[2324 {2526 "source": "/api/:path\*",2728 "destination": "/src/views/api/:path\*.js"2930 },3132 {3334 "source": "/product/:uid",3536 "destination": "/index.html"3738 },3940 {4142 "source": "/(.\*)",4344 "destination": "/index.html"4546 }4748 \],4950 "headers": \[5152 {5354 "source": "/index.html",5556 "headers": \[5758 {5960 "key": "Cache-Control",6162 "value": "no-store, no-cache, must-revalidate"6364 },6566 {6768 "key": "Pragma",6970 "value": "no-cache"7172 },7374 {7576 "key": "Expires",7778 "value": "0"7980 }8182 \]8384 }8586 \]8788}8990import path from "path";9192import fs from "fs";9394import htmlmin from "html-minifier";9596import EleventyVitePlugin from "@11ty/eleventy-plugin-vite";9798import pluginPug from "@11ty/eleventy-plugin-pug";99100101102export default function (*eleventyConfig*) {103104 // Temp folder for Vite105106 const tempFolder = ".11ty-vite";107108 if (!*fs*.existsSync(tempFolder)) *fs*.mkdirSync(tempFolder, { recursive: true });109110111112 // Plugins113114 *eleventyConfig*.addPlugin(pluginPug);115116117118 *eleventyConfig*.addPlugin(EleventyVitePlugin, {119120 tempFolderName: tempFolder,121122 viteOptions: {123124 root: "src",125126 publicDir: "public",127128 build: {129130 outDir: path.resolve(process.cwd(), ".11ty-vite"), // <- add this131132 emptyOutDir: true,133134 rollupOptions: {135136 input: {},137138 },139140 },141142 }143144145146 });147148149150 // Passthrough copy151152 *eleventyConfig*.addPassthroughCopy("public");153154 *eleventyConfig*.addPassthroughCopy("src/fonts");155156 *eleventyConfig*.addPassthroughCopy("src/app");157158159160161 // HTML minify162163 *eleventyConfig*.addTransform("htmlmin", (*content*, *outputPath*) => {164165 if (*outputPath* && *outputPath*.endsWith(".html")) {166167 return htmlmin.minify(*content*, {168169 useShortDoctype: true,170171 removeComments: true,172173 collapseWhitespace: true,174175 });176177 }178179 return *content*;180181 });182183184185 // Directory config186187 return {188189 dir: {190191 input: "src/views",192193 output: "\_site",194195 includes: "\_includes",196197 data: "\_data",198199 },200201 passthroughFileCopy: true,202203 htmlTemplateEngine: "pug",204205 pathPrefix: "/", // important for root-relative links206207 };208209}; "scripts": {210211 "prebuild": "mkdir -p .11ty-vite && rimraf \_site",212213 "build:vercel": "pnpm run prebuild && npx eleventy --config=.eleventy-build.js",214215 "vercel-build": "pnpm run build:vercel",216217 "build:win": "powershell -ExecutionPolicy Bypass -File build.ps1",218219 "dev": "eleventy --config=.eleventy.js --serve --incremental",220221 "clean": "rimraf \_site .11ty-vite"222223 },I dont understand why I keep getting this error Error: Unexpected output path (was not in output directory \_site): ./\_site/about/index.html