Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update script publish

Kiran Kd3ebeb44be19
diff --git a/.github/workflows/deploy-embed-script.yml b/.github/workflows/deploy-embed-script.yml
index 8333820714..b494997c83 100644
--- a/.github/workflows/deploy-embed-script.yml
+++ b/.github/workflows/deploy-embed-script.yml
@@ -18,11 +18,11 @@ jobs:
- name: Install dependencies & build
run: pnpm --filter @dub/embed-core build
- # - name: Deploy to Cloudflare Pages
- # uses: cloudflare/wrangler-action@v3
- # with:
- # apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_KEY }}
- # accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- # command: pages deploy dist --project-name=dub-cdn --commit-dirty=true
- # workingDirectory: packages/embeds/core
- # packageManager: pnpm
+ - name: Deploy to Cloudflare Pages (https://www.dubcdn.com/embed/script.js)
+ uses: cloudflare/wrangler-action@v3
+ with:
+ apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_KEY }}
+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ command: pages deploy dist/embed/script.js --project-name=dub-cdn --commit-dirty=true
+ workingDirectory: packages/embeds/core
+ packageManager: pnpm
diff --git a/packages/embeds/core/src/example/widget.html b/packages/embeds/core/src/example/widget.html
index 79e3fdd397..aabdeccffa 100644
--- a/packages/embeds/core/src/example/widget.html
+++ b/packages/embeds/core/src/example/widget.html
@@ -1,6 +1,6 @@
<html></html>
<head>
- <script type="module" src="../../dist/embed.js"></script>
+ <script type="module" src="../../dist/embed/script.js"></script>
</head>
<body>
<h1>Dub Referral Widget</h1>
diff --git a/packages/embeds/core/tsup.config.ts b/packages/embeds/core/tsup.config.ts
index 5d5f40d082..6bd87babde 100644
--- a/packages/embeds/core/tsup.config.ts
+++ b/packages/embeds/core/tsup.config.ts
@@ -1,8 +1,9 @@
import { defineConfig, Options } from "tsup";
export default defineConfig((options: Options) => ({
+ clean: true,
entry: {
- embed: "src/embed.ts", // Standalone entry for embed.ts
+ "embed/script": "src/embed.ts", // Standalone entry for embed.ts
index: "src/index.ts", // Entry for all other files via index.ts
},
format: ["cjs"],