From dfefa3b81d65cec8e77a914b355f5bc7b9c8cadd Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Tue, 13 Jan 2026 17:28:02 +0545 Subject: [PATCH] fix(OUT-2864): enabled sourcemaps and removed minified errors from tapwrite --- tsconfig-build.json | 16 +++++++++++++--- vite.config.ts | 22 ++++++++++++---------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/tsconfig-build.json b/tsconfig-build.json index 0d25f2b..8a395da 100644 --- a/tsconfig-build.json +++ b/tsconfig-build.json @@ -1,6 +1,16 @@ { "extends": "./tsconfig.json", - "include": [ - "lib" - ] + "compilerOptions": { + "outDir": "dist", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "inlineSources": true, + "module": "ESNext", + "target": "ES2019", + "moduleResolution": "Node", + "strict": true, + "esModuleInterop": true + }, + "include": ["lib"] } diff --git a/vite.config.ts b/vite.config.ts index 4e321b7..d5e049c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,34 +6,36 @@ import { extname, relative, resolve } from 'path' import { fileURLToPath } from 'node:url' import { glob } from 'glob' - export default defineConfig({ - plugins: [react(), dts({ include: ['lib'], insertTypesEntry: true }), libInjectCss()], + plugins: [ + react(), + dts({ include: ['lib'], insertTypesEntry: true }), + libInjectCss(), + ], build: { copyPublicDir: false, lib: { entry: resolve(__dirname, 'lib/main.ts'), - formats: ['es'] + formats: ['es'], }, + sourcemap: true, + minify: false, rollupOptions: { external: ['react', 'react/jsx-runtime', 'tailwindcss'], input: Object.fromEntries( - glob.sync('lib/**/*.{ts,tsx}').map(file => [ + glob.sync('lib/**/*.{ts,tsx}').map((file) => [ // The name of the entry point // lib/nested/foo.ts becomes nested/foo - relative( - 'lib', - file.slice(0, file.length - extname(file).length) - ), + relative('lib', file.slice(0, file.length - extname(file).length)), // The absolute path to the entry file // lib/nested/foo.ts becomes /project/lib/nested/foo.ts - fileURLToPath(new URL(file, import.meta.url)) + fileURLToPath(new URL(file, import.meta.url)), ]) ), output: { assetFileNames: 'assets/[name][extname]', entryFileNames: '[name].js', - } + }, }, }, })