-
Notifications
You must be signed in to change notification settings - Fork 201
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
fix: 适配Windows环境 #3090
base: next
Are you sure you want to change the base?
fix: 适配Windows环境 #3090
Conversation
你好 @Alexzjt,非常感谢你的贡献. Hello, @Alexzjt, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the docs if there are API changes. |
概述此PR旨在解决Windows环境下 变更
|
@@ -28,8 +28,8 @@ | |||
"bootstrap": "pnpm install", | |||
"bootstrap:ci": "pnpm bootstrap --frozen-lockfile", | |||
"prepare": "husky install", | |||
"clean": "pnpm -r --parallel exec rm -rf node_modules && rm -rf node_modules", | |||
"clean:lock-file": "rm -rf pnpm-lock.yaml", | |||
"clean": "pnpm -r --parallel exec rimraf node_modules && rimraf node_modules", |
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.
The command rm -rf
has been replaced with rimraf
to ensure compatibility across different operating systems, including Windows.
"build:umd": "pnpm -r --filter './packages/*' --stream build:umd", | ||
"build:size-limit": "pnpm -r --filter './packages/*' --stream build:size-limit", | ||
"build:size-limit-json": "pnpm -r --filter './packages/*' --stream build:size-limit-json", | ||
"build": "pnpm -r --filter \"{packages/**}\" --stream build", |
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.
The filter syntax has been updated to use double quotes and curly braces for cross-platform compatibility with pnpm.
"lint:fix": "run-s lint:fix-script lint:fix-style lint:fix-docs lint:fix-word", | ||
"lint:fix-word": "pnpm lint:word --fix", | ||
"lint:fix-script": "pnpm lint:script --fix", | ||
"lint:fix-style": "pnpm lint:style --fix", | ||
"lint:fix-docs": "pnpm lint:docs --fix", | ||
"site:start": "pnpm --filter @antv/s2-site start", | ||
"site:build": "NODE_OPTIONS='--max-old-space-size=4096' pnpm --filter @antv/s2-site build", | ||
"site:build": "cross-env NODE_OPTIONS=--max-old-space-size=4096 pnpm --filter @antv/s2-site build", |
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.
The NODE_OPTIONS
environment variable is now set using cross-env
to ensure it works on Windows.
👀 PR includes
✨ Feature
🎨 Enhance
🐛 Bugfix
🔧 Chore
📝 Description
兼容Windows环境下的package.json中的命令,主要是pnpm install和 pnpm run build。
替换 rm -rf → rimraf
替换 NODE_OPTIONS='...' → cross-env NODE_OPTIONS=...
使用双引号 " 替代单引号 '
统一路径分隔符为 /
🖼️ Screenshot
🔗 Related issue link
#2679
🔍 Self-Check before the merge