diff --git a/package-lock.json b/package-lock.json index 501a271..0edbf90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7604,7 +7604,7 @@ }, "packages/react": { "name": "@getopenpay/openpay-js-react", - "version": "0.1.10", + "version": "0.1.12", "license": "ISC", "dependencies": { "chalk": "^5.3.0", @@ -7686,7 +7686,7 @@ }, "packages/vanilla": { "name": "@getopenpay/openpay-js", - "version": "0.1.10", + "version": "0.1.12", "license": "ISC", "dependencies": { "chalk": "^5.3.0", diff --git a/packages/react/package-lock.json b/packages/react/package-lock.json index ee251d9..8372090 100644 --- a/packages/react/package-lock.json +++ b/packages/react/package-lock.json @@ -1,12 +1,12 @@ { "name": "@getopenpay/openpay-js-react", - "version": "0.1.9", + "version": "0.1.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@getopenpay/openpay-js-react", - "version": "0.1.9", + "version": "0.1.12", "license": "ISC", "dependencies": { "use-async-effect": "^2.2.7", diff --git a/packages/react/package.json b/packages/react/package.json index af3b2ff..db8af7c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@getopenpay/openpay-js-react", - "version": "0.1.11", + "version": "0.1.12", "description": "Accept payments through OpenPay, right on your site", "author": "OpenPay (https://getopenpay.com)", "private": false, diff --git a/packages/vanilla/package.json b/packages/vanilla/package.json index a1c8b76..ec97a3c 100644 --- a/packages/vanilla/package.json +++ b/packages/vanilla/package.json @@ -1,6 +1,6 @@ { "name": "@getopenpay/openpay-js", - "version": "0.1.11", + "version": "0.1.12", "description": "Accept payments through OpenPay, right on your site", "author": "OpenPay (https://getopenpay.com)", "license": "ISC", @@ -27,7 +27,7 @@ "scripts": { "lint": "eslint . --report-unused-disable-directives --max-warnings 0", "lint:fix": "eslint . --fix --report-unused-disable-directives --max-warnings 0", - "build": "tsc -p tsconfig.build.json && vite build", + "build": "tsc -p tsconfig.build.json && vite build && vite build --mode build-umd", "dev": "vite build --watch --mode development" }, "dependencies": { diff --git a/packages/vanilla/vite.config.ts b/packages/vanilla/vite.config.ts index c6ace74..8d3c499 100644 --- a/packages/vanilla/vite.config.ts +++ b/packages/vanilla/vite.config.ts @@ -8,7 +8,7 @@ export default defineConfig(({ mode }) => { esbuild: { // TODO: Uncomment this when we're stable // drop: mode === 'development' ? [] : ['console', 'debugger'], - sourcemap: 'inline', + sourcemap: mode === 'build-umd' ? false : 'inline', }, optimizeDeps: { include: ['penpal', 'uuid', 'zod'], @@ -17,12 +17,13 @@ export default defineConfig(({ mode }) => { emptyOutDir: mode === 'production', copyPublicDir: false, lib: { + formats: mode === 'build-umd' ? ['umd'] : ['es'], name: 'OpenPay', entry: resolve(__dirname, './index.ts'), fileName: (format) => `index.${format}.js`, }, rollupOptions: { - external: ['react', 'react-dom', 'zod', 'penpal', 'uuid', 'chalk'], // React is included in 'utils' + external: ['react', 'react-dom', ...(mode === 'build-umd' ? [] : ['zod', 'penpal', 'uuid', 'chalk'])], output: { assetFileNames: 'assets/[name][extname]', },