Questions tagged [vue-cli-3]

Vue-CLI provides the vue command in your terminal. It provides the ability to quickly scaffold a new project via vue create, or instantly prototype new ideas via vue serve. Use this tag for questions specific to version 3.

Vue CLI, created and maintained by the Vue's core team, is the official tooling for bootstrapping and maintaining your Vue projects.

Offering a feature rich and extensible platform for using (or developing your own) plugins and preset in zero-configuration and easily configurable fashion, as well as future-proofing the upgradebility of your project and tooling configurations.

Vue CLI ecosystem currently offers these Core Plugins:

  • @vue/cli-plugin-babel
  • @vue/cli-plugin-typescript
  • @vue/cli-plugin-eslint
  • @vue/cli-plugin-pwa
  • @vue/cli-plugin-unit-jest
  • @vue/cli-plugin-unit-mocha
  • @vue/cli-plugin-e2e-cypress
  • @vue/cli-plugin-e2e-nightwatch

There's a community site Awesome Vue CLI packages for browsing all the plugins and presets available.

Use this tag for questions specific to version 3.

695 questions
239
votes
15 answers

What is the difference between the views and components folders in a Vue project?

I just used the command line (CLI) to initialize a Vue.js project. The CLI created a src/components and src/views folder. It has been a few months since I have worked with a Vue project and the folder structure seems new to me. What is the…
drsnark
  • 2,813
  • 2
  • 15
  • 19
202
votes
14 answers

Using Environment Variables with Vue.js

I've been reading the official docs and I'm unable to find anything on environment variables. Apparently there are some community projects that support environment variables but this might be overkill for me. So I was wondering if there's something…
Edgar Quintero
  • 4,223
  • 2
  • 34
  • 37
119
votes
23 answers

How to solve 'vue-cli-service' is not recognized as an internal or external command?

I am getting an error when trying to run npm run serve. At first I installed node.js then vue as well as vue/cli. But when I am trying to run server as -> npm run serve at that time I'm getting error like 'vue-cli-service' is not recognized as an…
Dcoder14
  • 1,831
  • 3
  • 12
  • 22
64
votes
18 answers

Vue-cli 3 Environment Variables all undefined

I've tried all of the solutions out there but none seem to work for me. I just want to store some values in a .env file within my Vue app but simply trying to log process.env returns an empty object from within the component. My .env…
Doolan
  • 1,293
  • 1
  • 13
  • 28
63
votes
15 answers

Vue cli 3 hot reload suddenly not working in browsers

I have a Vue project generated by the Vue cli 3 and my hot reloading suddenly stopped working in my browsers. Changes made to the code are still picked up by the terminal, however, my browser is not picking up the changes. I have to manually refresh…
Gilian
  • 1,539
  • 2
  • 15
  • 27
39
votes
1 answer

What is the chunk-vendors.js file and how is it created? (Webpack)

I had a quick question regarding the chunk-vendors.js file that gets created during the build process for a Vue Js application. What is it? How is it created? The reason I'm asking is to better understand how certain things end up in it. I'm finding…
35
votes
6 answers

Vue-Cli: 'title' option for htmlWebpackPlugin does not work

I'm using vue-cli (3.4.1) and I'm trying to simply change the title of the document. I added the following to the vue.config.js chainWebpack: (config) => { config .plugin('html') .tap((args) => { …
Kristof Komlossy
  • 623
  • 2
  • 7
  • 19
31
votes
3 answers

Vue Cli unit test with jest how to run single test

I have vue application using the vue cli 3. During the setup process i chose jest as the testing framework. To run my unit tests i have a script in the package.json: test:unit": "vue-cli-service test:unit", and to run this i write in the vs code…
JimmyShoe
  • 2,009
  • 4
  • 21
  • 40
31
votes
2 answers

What is a-la-carte components? Should i use it?

When starting a new project using vue-cli it asks a few questions to customize the setup. Generally the project name, description, whether to use eslint for linting, karma and mocha for testing etc. This time it asked me ? Use a-la-carte…
Ragas
  • 3,005
  • 6
  • 25
  • 42
30
votes
2 answers

Why am I getting ERR_CONNECTION_TIMED_OUT in Vue.js?

After creating a new project with vue cli 3 I get this error: GET http://192.168.1.13:8080/sockjs-node/info?t=1538257166715 net::ERR_CONNECTION_TIMED_OUT sockjs.js?9be2:1605 Operation system: Windows 10
g miou
  • 365
  • 1
  • 4
  • 10
29
votes
3 answers

Cannot access Vue project by IP address on other devices vue cli 3 npm

I have a project created with vue cli 3. When I run the command "npm run serve", it gives the following success message (I replaced my IP address with fake #'s): App running at: - Local: http://localhost:8080/ - Network:…
Leesa
  • 740
  • 2
  • 11
  • 15
25
votes
5 answers

Vue Cli 3 Local fonts not loading

When trying to load custom local fonts in Vue CLI 3 the fonts still will not appear. I am not receiving any error messages. The inspector shows the correct rule being loaded, but fonts are falling back to serif on #app. Fonts are not showing up in…
P. Jack
  • 455
  • 1
  • 5
  • 11
24
votes
3 answers

Disable PWA plugin in Vue CLI 3

I'm having some issues with caching my files using the default service worker that comes with VueCLI 3. I would prefer to just use the default browser caching mechanism, but can't seem to disable the PWA plugin as its not in the vue.config.js file.…
Justin Kahn
  • 1,311
  • 2
  • 11
  • 16
22
votes
2 answers

How to add Vue Test Utils with Jest to already existing Vue-CLI 3 project?

I want to test an already existing Vue-CLI 3 project. I haven't initialized the testing preset when I was creating the project. I have searched, but haven't found any suitable results. I read the documentation also, but it said to add testing when…
Lucifer
  • 1,069
  • 4
  • 16
  • 26
22
votes
7 answers

How to upgrade my global vue-cli install to the latest version?

I already have vue-cli 3.5.5 installed. When I run vue create myapp, it shows message Update available 3.6.2. Vue CLI v3.5.5 ┌───────────────────────────┐ │ Update available: 3.6.2 │ └───────────────────────────┘ How to upgrade vue-cli to the…
HelloWorld101
  • 3,878
  • 2
  • 34
  • 47
1
2 3
46 47