From f621fbb224709288904b021570e65f42891d6391 Mon Sep 17 00:00:00 2001 From: Joe Marquardt <82404108+dotjoe@users.noreply.github.com> Date: Mon, 14 Jul 2025 15:13:11 -0500 Subject: [PATCH] fix the build on windows (#1148) - make-react importPath variable - esbuild entryPoints globby usage requires forward slashes --- packages/webawesome/scripts/build.js | 8 ++++---- packages/webawesome/scripts/make-react.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/webawesome/scripts/build.js b/packages/webawesome/scripts/build.js index ac300ccd6..5ef2acec0 100644 --- a/packages/webawesome/scripts/build.js +++ b/packages/webawesome/scripts/build.js @@ -8,7 +8,7 @@ import { replace } from 'esbuild-plugin-replace'; import { mkdir, readFile } from 'fs/promises'; import getPort, { portNumbers } from 'get-port'; import { globby } from 'globby'; -import { dirname, join, relative } from 'node:path'; +import { dirname, join, posix, relative } from 'node:path'; import process from 'node:process'; import { fileURLToPath } from 'node:url'; import ora from 'ora'; @@ -186,11 +186,11 @@ export async function build(options = {}) { join(rootDir, 'src/webawesome.loader.ts'), join(rootDir, 'src/webawesome.ssr-loader.ts'), // Individual components - ...(await globby(join(rootDir, 'src/components/**/!(*.(style|test)).ts'))), + ...(await globby(posix.join(rootDir, 'src/components/**/!(*.(style|test)).ts'))), // Translations - ...(await globby(join(rootDir, 'src/translations/**/*.ts'))), + ...(await globby(posix.join(rootDir, 'src/translations/**/*.ts'))), // React wrappers - ...(await globby(join(rootDir, 'src/react/**/*.ts'))), + ...(await globby(posix.join(rootDir, 'src/react/**/*.ts'))), ], outdir: getCdnDir(), chunkNames: 'chunks/[name].[hash]', diff --git a/packages/webawesome/scripts/make-react.js b/packages/webawesome/scripts/make-react.js index 402e46295..72d135112 100644 --- a/packages/webawesome/scripts/make-react.js +++ b/packages/webawesome/scripts/make-react.js @@ -25,7 +25,7 @@ for await (const component of components) { const tagWithoutPrefix = component.tagName.replace(/^wa-/, ''); const componentDir = path.join(reactDir, tagWithoutPrefix); const componentFile = path.join(componentDir, 'index.ts'); - const importPath = path.relative(srcDir, component.path); + const importPath = path.posix.relative(srcDir, component.path); // We only want to wrap wa- prefixed events, because the others are native const eventsToWrap = component.events?.filter(event => event.name.startsWith('wa-')) || [];