opentiny / opentiny/tiny-engine
🐛 [Bug]: Tiny Engine CLI形式process is not undefined
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 2.8k
- Forks
- 476
- Avg merge
- 17h 35m
- Merged PRs (30d)
- 1
Description
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"
}
}
在 在 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
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the mentioned vite.config.js and compare the configuration in a directly forked TinyEngine Design-demo with a project created through TinyEngine CLI. Reproduce the Vant setup and trace where the CLI-generated project handles the process environment; done means the configuration works without a pnpm patch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100