nextcloud-libraries / nextcloud-libraries/nextcloud-vite-config

[RFC] Set NODE_ENV from Vite's mode

Open
#635 0 comments 2 reactions 1 assignee View on GitHub

@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:

  • mode Vite param - changes Vite bundling process, e.g., optimization, minification
  • NODE_ENV env - 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.