Move Vite build plugins from dependencies to devDependencies

Đang mở Phù hợp với người mới
#1,244 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, vite
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu trong package.json và tìm vite-plugin-node-polyfills cùng @vitejs/plugin-vue trong dependencies. Chuyển cả hai mục sang devDependencies, chạy npm install --package-lock-only, sau đó build project và xác nhận rằng output của build không thay đổi và các plugin không còn là dependencies production nữa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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) ...
Ngôn ngữ chính
PHP
Star
106
Fork
84
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
14

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/user_saml

Tất cả issue của nextcloud/user_saml

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.