Move Vite build plugins from dependencies to devDependencies

Abierto Apto para principiantes
#1,244 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, vite
Área
build-system

Línea de trabajo

Comienza en package.json y localiza vite-plugin-node-polyfills y @vitejs/plugin-vue en dependencies. Mueve ambas entradas a devDependencies, ejecuta npm install --package-lock-only, luego compila el proyecto y confirma que la salida de la compilación no ha cambiado y que los plugins ya no son dependencias de producción.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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) ...
Lenguaje dominante
PHP
Estrellas
106
Forks
84
Merge medio
1 d 11 h
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextcloud/user_saml

Todos los issues de nextcloud/user_saml

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.