diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16604ca..9c5af28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,9 @@ jobs: - name: Build run: pnpm build + - name: Build Examples + run: pnpm build:examples + - name: Publish run: | git config --global user.name 'Doug Richar' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2142a9c..297ce06 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -58,3 +58,6 @@ jobs: - name: Build run: pnpm build + + - name: Build Examples + run: pnpm build:examples diff --git a/examples/api-search/vite.config.ts b/examples/api-search/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/api-search/vite.config.ts +++ b/examples/api-search/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/examples/claim-nfd/vite.config.ts b/examples/claim-nfd/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/claim-nfd/vite.config.ts +++ b/examples/claim-nfd/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/examples/link-address/vite.config.ts b/examples/link-address/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/link-address/vite.config.ts +++ b/examples/link-address/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/examples/mint/vite.config.ts b/examples/mint/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/mint/vite.config.ts +++ b/examples/mint/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/examples/nfd-metadata/vite.config.ts b/examples/nfd-metadata/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/nfd-metadata/vite.config.ts +++ b/examples/nfd-metadata/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/examples/resolve/vite.config.ts b/examples/resolve/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/resolve/vite.config.ts +++ b/examples/resolve/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/examples/reverse-lookup/vite.config.ts b/examples/reverse-lookup/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/reverse-lookup/vite.config.ts +++ b/examples/reverse-lookup/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/examples/set-metadata/vite.config.ts b/examples/set-metadata/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/set-metadata/vite.config.ts +++ b/examples/set-metadata/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/examples/set-primary-nfd/vite.config.ts b/examples/set-primary-nfd/vite.config.ts index e42dc7c..1a7bb85 100644 --- a/examples/set-primary-nfd/vite.config.ts +++ b/examples/set-primary-nfd/vite.config.ts @@ -12,4 +12,14 @@ export default defineConfig({ }, }), ], + define: { + global: 'globalThis', + }, + build: { + rollupOptions: { + // Workaround for vite-plugin-node-polyfills v0.24.0 + Vite 6 build issue + // See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 + external: ['vite-plugin-node-polyfills/shims/buffer'], + }, + }, }) diff --git a/package.json b/package.json index c232b80..4d706e1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "build": "pnpm --filter @txnlab/nfd-sdk build", - "build:examples": "pnpm --filter @txnlab/nfd-sdk-examples build", + "build:examples": "pnpm --filter './examples/*' build", "test": "pnpm -r test", "lint": "pnpm -r lint", "format": "pnpm -r format",