diff --git a/.gitignore b/.gitignore index 6ad61a66..555c82cd 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,7 @@ yarn-error.log* .envrc -examples/cdn/radix-dapp-toolkit.bundle.umd.cjs +examples/cdn/radix-dapp-toolkit.bundle.umd.js # Editor directories and files .vscode/* diff --git a/examples/cdn/index.html b/examples/cdn/index.html index e671f9a8..2530058d 100644 --- a/examples/cdn/index.html +++ b/examples/cdn/index.html @@ -15,7 +15,7 @@
- + diff --git a/packages/dapp-toolkit/package.json b/packages/dapp-toolkit/package.json index 96dd1fe4..bc53e3f3 100644 --- a/packages/dapp-toolkit/package.json +++ b/packages/dapp-toolkit/package.json @@ -55,7 +55,7 @@ "scripts": { "dev": "tsup --watch", "build": "tsup && npm run build:single", - "build:single": "vite build --config vite-single-file.config.ts && cp dist/radix-dapp-toolkit.bundle.umd.cjs ../../examples/cdn", + "build:single": "vite build --config vite-single-file.config.ts && cp dist/radix-dapp-toolkit.bundle.umd.js ../../examples/cdn", "test": "vitest run --coverage", "test:watch": "vitest --watch" }, diff --git a/packages/dapp-toolkit/vite-single-file.config.ts b/packages/dapp-toolkit/vite-single-file.config.ts index 2bc7f56f..482efd99 100644 --- a/packages/dapp-toolkit/vite-single-file.config.ts +++ b/packages/dapp-toolkit/vite-single-file.config.ts @@ -3,12 +3,20 @@ import { viteSingleFile } from 'vite-plugin-singlefile' export default defineConfig({ plugins: [viteSingleFile()], + build: { emptyOutDir: false, + lib: { entry: 'src/single-file.js', name: 'RDT', fileName: 'radix-dapp-toolkit.bundle', + formats: ['umd'], + }, + rollupOptions: { + output: { + entryFileNames: `radix-dapp-toolkit.bundle.umd.js`, + }, }, }, define: { 'process.env.NODE_ENV': '"production"' },