Nur Uddin
Nur Uddin

Reputation: 1840

should I add app.js file in gitignore for nodejs/vuejs app?

I am new to vuejs. Recently I noticed that when I pull, it says conflict in app.js file. But I can't find the issue as app.js file is big. Sould I add this file to gitignore file? what is best practice to work with vue js?

Upvotes: 1

Views: 2998

Answers (3)

Armando Herra
Armando Herra

Reputation: 76

If you are building the Vue project by scratch then I can say the following, when building/compiling your Vue project, best practices say that you should handle your entire production ready project in a dist/ or build/ directory where your main app.js file where the conflicts you are having would occur. This directory is only reserved for deploying the app and is not saved into your code repository, hence on why you should add to the .gitignore file the directory that holds such production files.

Upvotes: 0

Ulysse BN
Ulysse BN

Reputation: 11395

Here is the default vue-cli .gitignore:

.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

Not that not anything here may be useful to put in your own .gitignore. But you should for sure have at least node_modules and /dist.

Upvotes: 1

João Menighin
João Menighin

Reputation: 3225

I imagine you are building to a folder /dist and the app.js being conflited is the one inside of it.

You should ignore the /dist altogether. This folder is generated on the building process, meaning everyone that runs the project will update and create it.

Upvotes: 2

Related Questions