nextcloud-libraries / nextcloud-libraries/webpack-vue-config

RFC: future of this package

Open
#600 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
9
Forks
2
Avg merge
57m
Merged PRs (30d)
10

Description

I'd like to discuss the future of this package since we are migrating to @nextcloud/vite-config.

Current state

  • We are actively working on @nextcloud/vite-config, migrating to it, and call the migration a performance improvement for apps
  • This config is almost not maintained for a while

Issues with webpack-vue-config

  1. 🐌 It is slow and requires much RAM for a production build
  2. 📦 It injects CSS into JS impacting web performance
  3. ⛓️‍💥 Bad extending. It just exports config which is then mutated, making it not configurable on high level and less stable for changes
  4. 🌲 It has an old issue with less effective Tree Shaking

These issues can be solved:

  1. Migrating from babel + ts-loader + Terser to ESBuild makes it much faster (requires even less RAM than Vite)
  2. Adding MiniCssExtractPlugin to extract CSS
  3. Adding a good support for extending and configuration similar to @nextcloud/vite-config
  4. Not solvable afaik

Also, there is RSPack, a Rust-based Webpack compatible bundler.

Issue with Vite

  1. 🍴 It requires much more RAM on a production build than Webpack + ESBuild
  2. 🔬 It has an old problem with multiple JS entry points. It's optimized for building libraries and results in tons of micro-chunks-which is bad for performance. It is not so configurable in chunk generation as Webpack. it is not a problem for typical Vite users with index.html entrypoint, but it is for Nextcloud apps (example - text app).
  3. 🔎 Still lack of plugins. For even basic things we create our own plugins or use not widely used ones

Some problems might be solved via rolldown (likely brining new in the beginning) or fixed in the future.

Further options

1. Consider Vite the only recommended option

And mark this package as deprecated and maintenance-only

2. Support both

And develop a new major of nextcloud/webpack-config with some problems solved.

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.

Research direction

Start by reviewing the migration to @nextcloud/vite-config and the package’s listed Webpack and Vite limitations. Done means reaching and documenting a decision between making Vite the only recommended option or supporting both with a new major of nextcloud/webpack-config.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, vite, webpack
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.