nextcloud-libraries / nextcloud-libraries/nextcloud-vite-config
[RFC] Set NODE_ENV from Vite's mode
Open
@ShGKme is already working on this.
Since Jun 30, 2025.
1. to develop
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- Avg merge
- 14h 49m
- Merged PRs (30d)
- 26
Description
During bundling with Vite it has:
modeVite param - changes Vite bundling process, e.g., optimization, minificationNODE_ENVenv - changes some dependencies, e.g.,vue's prod or dev version with
It is not a problem when vite + vite build is used. But we usually use vite build for both. It requires more complex scripts (and not cross-platform):
"build": "vite build",
"dev": "NODE_ENV=development vite build --mode development",
"watch": "NODE_ENV=development vite build --mode development --watch"
We never use different NODE_ENV and mode values.
Proposal: set NODE_ENV inside Vite config according to the mode to simplify "scripts" and avoid issues from lost NODE_ENV.
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.
Assessment
This issue has not been assessed yet.