Skip to content

Commit

Permalink
fix umd build (#81)
Browse files Browse the repository at this point in the history
* update umd build

* bump ver
  • Loading branch information
zeyarpaing authored Dec 12, 2024
1 parent 6e4e361 commit 6e64456
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -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 <info@getopenpay.com> (https://getopenpay.com)",
"private": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/vanilla/package.json
Original file line number Diff line number Diff line change
@@ -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 <info@getopenpay.com> (https://getopenpay.com)",
"license": "ISC",
Expand All @@ -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": {
Expand Down
5 changes: 3 additions & 2 deletions packages/vanilla/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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]',
},
Expand Down

0 comments on commit 6e64456

Please sign in to comment.