-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: node version locked #355
Conversation
@pomelo-nwu CI好像得修下,都是红的 😆 |
是 build g6vp docker 镜像挂了... |
@tyn1998 刚看了下是这个问题:https://stackoverflow.com/questions/76435306/babel-preset-react-app-is-importing-the-babel-plugin-proposal-private-propert 在另一个分支上提个了 commit 修复了:721a661#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R60 你的这个我就先合并了,影响不大 |
"build": "node --experimental-json-modules scripts/pre-build.mjs && NODE_OPTIONS=--max_old_space_size=4096 umi build", | ||
"build:docker": "cd ../../ && npm run build:all:umd && cd packages/gi-site/ && BUILD_MODE=docker node scripts/pre-build.mjs && node scripts/copy-assets.mjs && BUILD_MODE=docker NODE_OPTIONS=--max_old_space_size=4096 umi build", | ||
"deploy": "node ./scripts/deploy.js", | ||
"start": "node scripts/pre-build.mjs && cross-env NODE_OPTIONS=--max_old_space_size=4096 cross-env PORT=8000 umi dev" | ||
"start": "node --experimental-json-modules scripts/pre-build.mjs && cross-env NODE_OPTIONS=--max_old_space_size=4096 cross-env PORT=8000 umi dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个--experimental-json-modules
在16.14版本还是需要的,但是16.20版本就已经不需要了。具体是哪个版本开始不需要这个flag的我没有实测,总之是追加一个评论FYI。
👀 PR includes
✨ Feature
🎨 Enhance
🐛 Bugfix
🔧 Chore
📝 Description
锁定 Node 版本为 16,因为:
此外,还在根目录添加了
.nvmrc
文件,这样的话进入子包目录也会自动切换node版本为16。根据这个调整修改了README和CONTRIBUTION文件。另外经过测试,Node 18版本及以上不需要
--experimental-json-modules
这个flag就能import json modules,但是16及以下版本需要,否则会报错,于是像 #271 那样在gi-site/package.json
中添加了这个flag。🔗 Related issue link
close #257,还可以参考的:#254 (review)
🔍 Self-Check before the merge