Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue Cli 3.0 where is the config file?

Tags:

vue.js

vue-cli

I've seen it mentioned in docs, etc the vue.config.js file. And also noted previously these are handled in the webpack config file, etc in 2.0. But I can't find either file in my project folder created with vue cli 3.0... Where is the config files and why isn't it anywhere in the top level folders, etc?

like image 883
Kelvin Zhao Avatar asked Mar 22 '18 08:03

Kelvin Zhao


People also ask

Where is vue config js located?

config. js is an optional config file that will be automatically loaded by @vue/cli-service if it's present in your project root (next to package. json ). You can also use the vue field in package.

Where is the webpack config file vue?

The webpack-simple template has the webpack-config. js file directly in root of your project folder. Looks like you are using webpack template. To make changes to the webpack config goto the build folder.

Where is vue CLI service installed?

Inside a Vue CLI project, @vue/cli-service installs a binary named vue-cli-service . You can access the binary directly as vue-cli-service in npm scripts, or as ./node_modules/. bin/vue-cli-service from the terminal.


1 Answers

Where is the config files and why isn't it anywhere in the top level folders, etc?

The initial project doesn't require the file to exist because you just created a project with fresh "default" settings that don't require any config.

Just create it yourself. it's even mentioned in the README:

Many aspects of a Vue CLI project can be configured by placing a vue.config.js file at the root of your project. The file may already exist depending on the features you selected when creating the project.

(emphasis mine)

Edit: now to be found here: https://cli.vuejs.org/config/#global-cli-config

like image 64
Linus Borg Avatar answered Sep 29 '22 13:09

Linus Borg