0

I am using nodemon in a straight forward express app, something has recently happened and every-time I save a child file in a folder, a dist folder is created and a child file created with the same name - with the addition of .dev. in the filename.

As far as I understand a dist file is created only once I finally compile the app for production - not when in development?

How can I stop the dist file from getting created each time I save?

My package.json

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "nodemon index.js"
  },

i.e

Before Save

- routes
    - tests.route.js

After Save

- routes
   - dist
     - tests.route.dev.js
   - tests.route.js
tbowden
  • 1,008
  • 1
  • 19
  • 44
  • dist is usually the "compiled" JS version of some TS code. Do you have any typescript files in the project? any `tsconfig.json` perhaps? – Mohamed Emad Oct 08 '21 at 12:19
  • I did a search for any .ts files in the project incase I missed any. I can't see any! – tbowden Oct 08 '21 at 12:36
  • wait by save do you mean it gets created every time you save your project? – Mohamed Emad Oct 08 '21 at 12:39
  • Every time I save a file in the given folder - yes. It either creates a new .dev. file or overwrites one that has already been created - in the dist folder. – tbowden Oct 08 '21 at 12:40
  • 1
    this feels more like an IDE problem rather than a Nodemon one. maybe one of your extensions is acting up? or maybe try with a different ide. – Mohamed Emad Oct 08 '21 at 12:41
  • Thanks for your help! Based on your above suggesting I found this article: https://stackoverflow.com/questions/62179606/vs-code-create-folder-automatically-with-dist-name Which has solved the issue. – tbowden Oct 08 '21 at 12:48

2 Answers2

1

I was using a plugin called: Sass/Less/Typescript/Jade/Pug Compile Hero Plugin with VScode, it was creating a new dist file on every save.

I followed this to fix it: Vs code create folder automatically with (dist) name - Basically you want to uninstall the plugin.

tbowden
  • 1,008
  • 1
  • 19
  • 44
0

For fixing it I follow these steps Given bellow and it is solved:-

  1. Click on Extensions button of VS Code or press Ctrl+Shift+X.
  2. Search for Hero Extension which shown bellow. enter image description here
  3. Click on Disable.
  4. Click on Reloade.
Abhay Kumar Upadhyay
  • 2,117
  • 1
  • 7
  • 12