rslib 是否支持打包 ink tui framework??? 做了这个适配吗? #1700
Replies: 1 comment
-
|
Thanks for the reproduction. Rslib does not need a special Ink adapter. Ink is a React renderer, so the key is to configure the project as a Node ESM build with React JSX transform enabled. I noticed a few config issues in the reproduction:
Recommended changes: pnpm add -D @rslib/core@latest @rsbuild/plugin-react@latestUpdate import { pluginReact } from '@rsbuild/plugin-react';
import { defineConfig } from '@rslib/core';
export default defineConfig({
source: {
entry: { index: './src/index.tsx' },
},
lib: [
{
format: 'esm',
bundle: true,
output: {
distPath: { root: './dist' },
filename: { js: 'index.mjs' },
},
banner: { js: '#!/usr/bin/env node' },
},
],
output: {
target: 'node',
sourceMap: true,
minify: true,
},
plugins: [pluginReact()],
});And keep {
"compilerOptions": {
"jsx": "react-jsx"
}
}Do not set: {
"jsxImportSource": "ink"
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/juwenzhang/rag-chat-cli/tree/master/clients/tui
使用 Rslib 打包 Ink(React 终端 UI)项目后,运行产物报错:ReferenceError: React is not defined
想确认 Rslib 是否兼容 Ink 项目打包,以及该如何配置解决此问题
Beta Was this translation helpful? Give feedback.
All reactions