-
Notifications
You must be signed in to change notification settings - Fork 340
fix(build): stabilize rollup terser on Windows by limiting workers #1138
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ import analyze from 'rollup-plugin-analyzer'; | |||||||||||||||||
|
|
||||||||||||||||||
| const packageJson = require('./package.json'); | ||||||||||||||||||
| const PRODUCTION = process.env.NODE_ENV === 'production'; | ||||||||||||||||||
| const TERSER_OPTIONS = { numWorkers: 1 }; | ||||||||||||||||||
|
||||||||||||||||||
| const TERSER_OPTIONS = { numWorkers: 1 }; | |
| const TERSER_NUM_WORKERS = process.env.TERSER_NUM_WORKERS; | |
| const TERSER_OPTIONS = | |
| TERSER_NUM_WORKERS != null && TERSER_NUM_WORKERS !== '' | |
| ? { numWorkers: Number(TERSER_NUM_WORKERS) } | |
| : process.platform === 'win32' | |
| ? { numWorkers: 1 } | |
| : {}; |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,6 +10,7 @@ import analyze from 'rollup-plugin-analyzer'; | |||||||
| import dts from 'rollup-plugin-dts'; | ||||||||
|
|
||||||||
| const PRODUCTION = process.env.NODE_ENV === 'production'; | ||||||||
| const TERSER_OPTIONS = { numWorkers: 1 }; | ||||||||
|
||||||||
| const TERSER_OPTIONS = { numWorkers: 1 }; | |
| const TERSER_OPTIONS = | |
| process.platform === 'win32' ? { numWorkers: 1 } : {}; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,6 +10,7 @@ import analyze from 'rollup-plugin-analyzer'; | |||||||||||||||||||||||
| import dts from 'rollup-plugin-dts'; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| const PRODUCTION = process.env.NODE_ENV === 'production'; | ||||||||||||||||||||||||
| const TERSER_OPTIONS = { numWorkers: 1 }; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| const TERSER_OPTIONS = { numWorkers: 1 }; | |
| const TERSER_NUM_WORKERS_ENV = process.env.TERSER_NUM_WORKERS; | |
| const TERSER_NUM_WORKERS = | |
| TERSER_NUM_WORKERS_ENV && !Number.isNaN(Number(TERSER_NUM_WORKERS_ENV)) | |
| ? Number(TERSER_NUM_WORKERS_ENV) | |
| : process.platform === 'win32' | |
| ? 1 | |
| : undefined; | |
| const TERSER_OPTIONS = TERSER_NUM_WORKERS | |
| ? { numWorkers: TERSER_NUM_WORKERS } | |
| : {}; |
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.
Good point. I kept this unconditional intentionally to prioritize build stability and keep the change minimal.
Happy to make it platform-specific or configurable if that’s preferred by maintainers.
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.
Optional:
numWorkers: 1is applied unconditionally, which may slow down production builds on non-Windows platforms too. If the instability is Windows-specific, consider making this conditional (e.g., only onprocess.platform === 'win32') or configurable via an environment variable so CI/macOS/Linux can keep parallel minification.