Files
self/sdk/qrcode/tsup.config.ts
Kartik Mehta bebaebc872 QR code SDK Redesign (#1536)
* Refactor NFC scanner tests to use a global variable for platform OS, allowing dynamic switching between iOS and Android during tests. This change improves test isolation and avoids hoisting issues with jest.mock.

* Triggering GitHub workflows

* Add status animations and self logos

* Update utilities and styles for statuses

* Remove old LED implementation and occurences

* Update Self QR Code with new design

* Add status banner

* Remove console and use QRcodeSteps in styles

* Add ARIA and use Memo to prevent re-renders

* Add refs for success and error callbacks

* Use ref for self app in qrcode

* Use selfapp ref consistently

* Update connected state animtion

* Skip 'parses Android response' test in nfcScanner

---------

Co-authored-by: Justin Hernandez <justin.hernandez@self.xyz>
Co-authored-by: Javier Cortejoso <javier.cortejoso@gmail.com>
2026-01-21 23:07:24 +10:00

71 lines
1.7 KiB
TypeScript

import path from 'path';
import { defineConfig } from 'tsup';
import { fileURLToPath } from 'url';
// Shared entry map to keep ESM/CJS builds in sync
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const entries = {
index: 'index.ts',
'components/SelfQRcode': 'components/SelfQRcode.tsx',
'utils/utils': 'utils/utils.ts',
'utils/styles': 'utils/styles.ts',
'utils/websocket': 'utils/websocket.ts',
};
export default defineConfig([
{
tsconfig: './tsconfig.json',
entry: entries,
format: ['esm'],
outDir: path.resolve(__dirname, 'dist/esm'),
outExtension: ({ format }) => ({ js: format === 'cjs' ? '.cjs' : '.js' }),
dts: false,
splitting: false,
clean: true,
sourcemap: true,
target: 'es2020',
platform: 'neutral',
loader: {
'.svg': 'dataurl',
},
publicDir: path.resolve(__dirname, 'assets'),
external: [
/^react/,
/^react-dom/,
/^react\/jsx-runtime$/,
/^lottie-react/,
/^qrcode.react/,
/^socket.io-client/,
/^node-forge/,
],
},
{
tsconfig: './tsconfig.cjs.json',
entry: entries,
format: ['cjs'],
outDir: path.resolve(__dirname, 'dist/cjs'),
outExtension: ({ format }) => ({ js: format === 'cjs' ? '.cjs' : '.js' }),
dts: false,
splitting: false,
clean: false,
sourcemap: true,
target: 'es2020',
platform: 'neutral',
loader: {
'.svg': 'dataurl',
},
publicDir: path.resolve(__dirname, 'assets'),
external: [
/^react/,
/^react-dom/,
/^react\/jsx-runtime$/,
/^lottie-react/,
/^qrcode.react/,
/^socket.io-client/,
/^node-forge/,
],
},
]);