Skip to content

RFC: future of this package #600

@ShGKme

Description

@ShGKme

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions