Description
We have been discussing an upgrade for vue-cli
for a while, in order to address a few issues in the current version.
Problems
-
Currently, project build configurations are directly included in the template. This leads to a few problems:
-
once created, it becomes difficult to upgrade an existing project to track latest changes in the remote template;
-
pulling directly from github lacks proper version control mechanism that npm packages have;
-
less experienced users can get intimidated by the seemingly complex code in the
build
directory.
-
-
Too many decisions to make upfront resulting in a less smooth onboarding experience.
The user has to first pick a template, but for beginners they usually do not possess the experience to decide which template fits their use case best. The official
webpack
template has a number of questions regarding linters and test tools, which can also be intimidating for beginners.
Solutions
-
vue-cli@3.0
will be moving towards a "config/scripts in a package" model, which is commonly used among several other tools: -
Instead of forcing users to make non-reversible decisions upfront, we would:
-
Phase out browserify support. There will be just one template which is webpack based.
-
Configurations for common use cases (pwa, ts, ssr) can be added on demand via presets, similar to how Neutrino/Poi works. The presets can be maintained and versioned individually.
-
-
In addition to the encapsulated package, we will also offer the ability to configure the tooling via
vue.config.js
. This file exposes two functionalities:-
A centralized entry for configuring/toggling high-level built-in features, e.g. env variables, css extraction, API proxying.
-
Get lower level access to the underlying webpack config and tweak it (probably with webpack-chain). This essentially works like a local preset.
-
Other Ideas
-
We will probably split out
vue build
into an addon (e.g.vue-cli-build
) so the initial install ofvue-cli
can be faster.vue build
can simply try to callvue-cli-build
, and prompt installation if it is not found. -
vue list
will be deprecated, OR list available presets instead. -
Default integration of
vue-test-utils
and probably Jest as the runner (although it can lead to license concerns) -
Better error reporting, e.g. jumping directly to source code from error overlay.
-
Grep for common warning / error messages and suggest potential doc links.
-
Auto port detection (suggested by @billyryanwill)
-
Your idea here
I realize this is in fact very similar to Poi and since @egoist has been an active contributor to vue-cli
itself, I would love to get feedback from @egoist and potentially collaborate with him to build the new version. Maybe we can even build this on top of a fork of Poi?
/cc @vuejs/collaborators