2
0

🧑‍💻 Fix type resolution for @typebot.io/react and nextjs

Closes #968
This commit is contained in:
Baptiste Arnaud
2023-10-26 15:57:55 +02:00
parent 3f7f0944e1
commit 31b3fc311e
9 changed files with 93 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.2.9",
"version": "0.2.10",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -37,6 +37,7 @@
"eslint-config-custom": "workspace:*",
"react": "18.2.0",
"rollup": "3.26.2",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-typescript-paths": "1.4.0",
"tslib": "2.6.0",
"tsx": "3.12.7",

View File

@@ -4,6 +4,7 @@ import { babel } from '@rollup/plugin-babel'
import typescript from '@rollup/plugin-typescript'
import { typescriptPaths } from 'rollup-plugin-typescript-paths'
import alias from '@rollup/plugin-alias'
import { dts } from 'rollup-plugin-dts'
const extensions = ['.ts', '.tsx']
@@ -31,6 +32,23 @@ const indexConfig = {
],
}
const configs = [indexConfig]
const typesConfig = {
input: './src/index.ts',
output: [{ file: './dist/index.d.ts', format: 'es' }],
plugins: [
alias({
entries: [
{ find: '@typebot.io/js', replacement: '../../js' },
{
find: '@/types',
replacement: '../types',
},
],
}),
dts(),
],
}
const configs = [indexConfig, typesConfig]
export default configs

View File

@@ -6,9 +6,6 @@
"paths": {
"@/*": ["src/*"]
},
"declaration": true,
"declarationMap": true,
"outDir": "dist",
"emitDeclarationOnly": true
"outDir": "dist"
}
}