From 3ec4e6de0767b6b401cc616e447a0545a809d44a Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Fri, 10 Jan 2025 12:50:41 -0500 Subject: [PATCH 1/3] Fix build --- docs/.eleventy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/.eleventy.js b/docs/.eleventy.js index 0ed4214ca..86bba34fd 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -26,8 +26,8 @@ const globalData = { layout: 'page.njk', }; -const passThroughExtensions = ['css', 'png', 'svg', 'jpg', 'mp4']; -const passThrough = ['docs/**/*.js', ...passThroughExtensions.map(ext => '**/*.' + ext)]; +const passThroughExtensions = ['js', 'css', 'png', 'svg', 'jpg', 'mp4']; +const passThrough = [...passThroughExtensions.map(ext => 'docs/**/*.' + ext)]; export default function (eleventyConfig) { // NOTE - alpha setting removes certain pages From 3a33fa208ae690915d14b9860e51d07ef4a01fc9 Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Fri, 10 Jan 2025 13:00:24 -0500 Subject: [PATCH 2/3] Add command for testing the build without having to push to Vercel --- README.md | 2 ++ package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 50e25762d..b78d9ce2a 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ To generate a production build, run the following command. npm run build ``` +You can also run `npm run build:serve` to start an [`http-server`](https://www.npmjs.com/package/http-server) instance on `http://localhost:4000` after the build completes, so you can preview the production build. + ### Creating New Components To scaffold a new component, run the following command, replacing `wa-tag-name` with the desired tag name. diff --git a/package.json b/package.json index 898721bd4..c9ebb3eab 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "scripts": { "start": "node scripts/build.js --develop", "build": "node scripts/build.js", + "build:serve": "npm run build && npx http-server _site -p 4000", "build:alpha": "node scripts/build.js --alpha", "start:alpha": "node scripts/build.js --alpha --develop", "publish-alpha-cdn": "./publish-alpha-cdn.sh", From bc6fe95f132bb9e0ae04df0da8c2cf90747df448 Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Fri, 10 Jan 2025 13:05:23 -0500 Subject: [PATCH 3/3] `npm run build:alpha:serve` per @KonnorRogers suggestion --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c9ebb3eab..2ca2c0372 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "build": "node scripts/build.js", "build:serve": "npm run build && npx http-server _site -p 4000", "build:alpha": "node scripts/build.js --alpha", + "build:alpha:serve": "npm run build:alpha && npx http-server _site -p 4000", "start:alpha": "node scripts/build.js --alpha --develop", "publish-alpha-cdn": "./publish-alpha-cdn.sh", "create": "plop --plopfile scripts/plop/plopfile.js",