Move Vite build plugins from dependencies to devDependencies

Aperta Adatta ai principianti
#1,244 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, vite
Ambito
build-system

Direzione di ricerca

Inizia in package.json e individua vite-plugin-node-polyfills e @vitejs/plugin-vue in dependencies. Sposta entrambe le voci in devDependencies, esegui npm install --package-lock-only, quindi esegui la build del progetto e conferma che l'output della build non sia cambiato e che i plugin non siano più dipendenze di produzione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

0. Needs triage bug
How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

vite-plugin-node-polyfills and @vitejs/plugin-vue are listed under dependencies in package.json, but they are only used at build time by Vite. The shipped app contains the built js/ bundles, not node_modules.

Because they sit in dependencies, the production SBOM includes their whole dependency tree. That includes the Node crypto polyfill chain (node-stdlib-browser → crypto-browserify → browserify-sign/create-ecdh → elliptic), even though elliptic is not in any built bundle.

Moving both packages to devDependencies:

  • takes elliptic and the rest of the crypto polyfill chain out of the production dependency tree;
  • reduces the production npm tree from 499 to 287 packages;
  • does not change the build output, since Vite still bundles the buffer, global and process shims at build time.

Checked against v8.4.0 by moving both entries, running npm install --package-lock-only, and building.

Steps to reproduce
  1. build and check output
Expected behaviour

no vite plugins as deps but devdeps

Actual behaviour

defined as deps

Server configuration

Web server: Apache/Nginx

Database: MySQL/Maria/SQLite/PostgreSQL

PHP version: 8.5/8.4/8.3

Nextcloud version: (see Nextcloud admin page)

List of activated apps
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Nextcloud configuration
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder
Browser

Browser name: Firefox/Chrome/Safari/…

Browser version: 124/125/…

Operating system: Windows/Ubuntu/Mac/…

Browser log
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
Lingua principale
PHP
Stelle
106
Fork
84
Merge medio
1g 11h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextcloud/user_saml

Tutte le issue di nextcloud/user_saml

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.