-1

Whenever I run "npm start" it always deletes, and even "reset" files, that I add in my .nuxt folder. As in, when I add, as an example, a new component in the .nuxt > "components" folder, press CTRL + C in cmd to stop the server and then restart running "npm start", it always "resets" the .nuxt folder to its initial/install state. Why is this happening?
I am using "FeathersJS" for backend and "NuxtJS" for frontend.

package.json:

"scripts": {
"test": "npm run eslint && npm run mocha",
"eslint": "eslint src/. test/. --config .eslintrc.js",
"build": "nuxt build",
"dev": "SET DEBUG=nuxt:* && nodemon --watch src/ --watch config/ src/index.js",
"prestart": "npm run build",
"start": "SET NODE_ENV=production && nodemon src/",
"mocha": "mocha test/ --recursive"
},

2 Answers2

4

You shouldn't even add or delete anything from .nuxt. It is files generated by .nuxt. You should modify your sources only, not a generated files.

Aldarund
  • 17,312
  • 5
  • 73
  • 104
  • Okay? Then how do I add something like a menu component into default? I don't want to have to import the menu component every time I make a new page/view. Is there a way to do that? –  Sep 07 '18 at 18:21
  • @FelixMichaelCervin its not the best idea. But if you want you need to put it into plugin https://nuxtjs.org/guide/plugins/#vue-plugins – Aldarund Sep 07 '18 at 18:34
-2

I have found my own solution now. The solution can be found here, for future reference: https://github.com/fexell/FeathersJS-NuxtJS