tiny-engine icon indicating copy to clipboard operation
tiny-engine copied to clipboard

🐛 [Bug]: Tiny Engine CLI形式process is not undefined

Open sela0629 opened this issue 5 months ago • 0 comments

Environment

MacPro Chrome

Version

V18.20.4

Version

TinyEngine2.5.1

Link to minimal reproduction

Step to reproduce

引入了vantUI { { "name": "vant-ui组件库", "package": "vant", "version": "4.19.8", "script": "https://registry.npmmirror.com/vant/4.9.18/files/es/index.mjs", "css": "https://registry.npmmirror.com/vant/4.9.18/files/lib/index.css" }, { "name": "vant-ui组件库", "package": "@vant/use", "version": "1.6.0", "script": "https://registry.npmmirror.com/@vant/use/1.6.0/files/dist/index.esm.mjs" }, { "name": "@vue/shared", "package": "@vue/shared", "version": "3.5.14", "script": "https://registry.npmmirror.com/@vue/shared/3.5.14/files/dist/shared.esm-bundler.js" }, { "name": "@vant/popperjs", "package": "@vant/popperjs", "version": "1.3.0", "script": "https://registry.npmmirror.com/@vant/popperjs/1.3.0/files/dist/index.esm.mjs" } }

Image

在 在 vite.config.js 中增加 process 变量的注入:

const customConfig = { envDir: './env', publicDir: path.resolve(__dirname, './public'), server: { port: 8090 }, 👇 在这里增加 define: { process: { env: { NODE_ENV: process.env.NODE_ENV } } } }

直接fork的TinyEngine中 Design-demo可正常,但使用TinyEngineCli形式创建的项目中修改后无效,只能对源码进行pnpm patch 修改 预期项目新增下面代码,进行修复,后续版本可取消patch

Image

What is expected

No response

What is actually happening

No response

What is your project name

TinyEngine2.5.1

Any additional comments (optional)

No response

sela0629 avatar Jul 12 '25 04:07 sela0629