-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kickoff: 3.0 plans #589
Comments
This is what I imagine vue-cli might look like:
The commands we set in
Basically a create-react-app + react-scripts structure but we don't eject, we make use of webpack-chain instead. |
@egoist yep, exactly. Would you be interested in starting this? Feels like we can reuse/learn a lot from Poi. I currently have my hands full with 2.5, won't be able to work on this until that's released. |
Also, maybe we should make sure the whole flow is proxy-proof for enterprise usage. |
A really tiny thing from me (I love vue-cli already), would be automatic port hopping if the default port is already being used. A few of our less technical members have struggled setting up and aren't comfortable changing the port it runs on so it would be cool if this could be implemented! If I'm being ignorant and this is already an option then please set me straight :) |
@billyryanwill good point, that's definitely something people have been asking for. |
@billyryanwill @yyx990803 The |
Is a template for distributable components part of the roadmap? |
I personally enjoy POI a lot and it's presets. I think it's more controllable than create-react-app. |
We also need to deploy to a staging server as well, and the first thing we do on a vue-cli setup is remove the hardcoded NODE_ENV=production I think there should be some thought in here as to how to allow this workflow out of the box. |
I would suggest an |
@HerringtonDarkholme with webpack-chain you actually get full control of your webpack config, and it's hard to have both |
Maybe Neutrino (https://neutrino.js.org/) by Mozilla is a good fit? It provides "presets" which can be easily customized and extended when needed. Description - https://davidwalsh.name/neutrino |
Maybe contribute to https://github.com/geowarin/friendly-errors-webpack-plugin (or a fork if necessary)
Sure, maybe start with making a Vue preset for Neutrino and wrap them all in a cli like vue-scripts or similar. |
@egoist I don't think eject can be replaced by webpack chain. For example, webpack chain doesn't generate other configuration file like .babelrc, .postcssrc, etc. Also, users have to write their own eject/export function.
Can you elaborate why it is hard? IMHO eject is one-way operation. that means, once ejected, the project is no longer influenced by preset. Upstream preset change don't need to be applied to ejected projects. |
Well, you don't need to eject to use a |
Is it also possible to add development build command in package.json like vue-scripts build-dev: Build app for development use (webpack) this is specially useful if you want to test and debug on remote server. |
How much effort do you believe this would take? Assuming I know very little about the subject but would be willing to learn :) |
Maybe presets or something to optionally add tools like CSS lint, eslint, storybook, visual testing etc. |
Vuex is so commonly used, it would be good to add a Vuex option. |
Any thoughts on renaming it to |
@elpete FYI, there's already create-vue-app |
Will multi entries be supported in one project? |
Specify port from cli: vuejs-templates/webpack#923 |
This sounds exactly like the process i built. 😄 |
@brianvoe That animation ✨ |
@posva Thanks! |
If we say created a project with vue-cli webpack template for example and you've updated the template to include fixes, new features/configuration etc, will there be a way to update it to the latest version in place? Like react you can update the Something like: |
No, The "ole" templates will not get an update mechanism. But new projects created with the new cli will. |
Sounds spot on. V3 onwards I gather? |
Since v3 is made from scratch with a complete new architecture, it's safe to say that it will not be retro-compatible. |
also i think on vue-cli or webpack template static path on build prod should be fixed... all the assets are currently build as src=static/js/..... which on windows os or xampp apache is undefined path unless i change all to ./static/js/ .... root path : http://localhost/prodbuild/ static path on npm run build : static/[js/css]/.... in which the browser is assuming the assets are on http://localhost/static/[js/css/]/... instead of http://localhost/prodbuild/static/[js/css]/... thanks |
This is not a thing to be discussed here, the webpack template has its own repository. |
I have to say I was really curious to try out v3 as I have been using my own custom templates with v2. However the requirement of yarn rather than something like lerna which is compatible with npm as well is a huge non starter for me. |
@LinusBorg What I meant by multiple configs is, come devs or designers may want to have, for example, the choice to save different presets, rather than one default configuration. |
@codetheorist 3.x allows you to save multiple presets. |
How do we pass options to the webpackConfig object? I would like to modify some options which are passed in |
@ralrom docs are not ready yet, but here's how: Create a // vue.config.js
module.exports = {
chainWebpack: chainableConfig => {
// modify config with webpack-chain
// https://github.com/mozilla-neutrino/webpack-chain
},
configureWebpack: config => {
// mutate config directly, or return new config
},
// object literal will be merged into base config using webpack-merge
configureWebpack: {
// ...
}
} |
@yyx990803 Where should it be copied? The simple presence of But when added to Is there any other side effect when using |
module.exports = {
lintOnSave: true,
configureWebpack: ...
} |
It works, thanks 😉 |
How do you enable source maps to those loaders on the 3.0 CLI? |
How can I make it as a multi-page application?
Or I only can achieve this by setting webpack in vue.config.js? |
Closing this as we are close to the first beta of 3.0 - if you have any particular feedback regarding current alpha, please submit issues with specific details. Thanks everyone for participating in the discussion. |
你好! 我有时候会用hbuilder直接打包成安卓的app,在vue cli 2.0中只要将的config下的index.js的改成assetsPublicPath: './',路径就完全正确.在3.0中我需要自己将dist里的html引用加点 就像这样 能不能加个webapp模式 ??? |
why yarn build when i am using npm ? very confusing and where did the webpack config go on vue-cli 3? |
the whole point is that you don't _have_ to worry about the webpack config.
It's abstracted away behind one easily upgradable depedency
…On Wed, Feb 21, 2018 at 5:43 AM, Serak Shiferaw ***@***.***> wrote:
why *yarn build* when i am using npm ? very confusing and where did the
webpack config go on vue-cli 3?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#589 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AACoukZI3zaenIljNMVx9b9RMxr4rUfqks5tW_NlgaJpZM4PU2yY>
.
|
what happens when there is a bug in default config file. i use to change some value in config/index.js so than when i build for production every link works as it should be
|
@serak take a look at the configuration docs: https://github.com/vuejs/vue-cli/blob/dev/docs/config.md more specifically the |
@serak read the documentation please. Locking this thread. |
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
The text was updated successfully, but these errors were encountered: