question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dist file being deleted when saving src file with no changes

See original GitHub issue
  • Laravel Mix Version: 0.12.1
  • Node Version (node -v): 7.9.0
  • NPM Version (npm -v): 4.2.0
  • OS: Mac OS Sierra Version 10.12.5

Description:

Whenever I save my src/js/app.js or src/scss/app.scss, my dist/js/app.js and vendors (if I extract them) will get deleted, so I have to make a real change like writing a console.log() or deleting some lines for it to recompile and recreate the file.

Steps To Reproduce:

I’ve tested a clean installation of laravel-mix in a non-laravel project, with the following config in webpack.mix.js:

mix.js(‘src/js/app.js’, ‘dist/js’) .sass(‘src/scss/app.scss’, ‘dist/css’);

1 - $ npm run watch 2 - Save any of the src/… files without making changes and the dist/js/app.js will disappear.

Note: I’ve tested with laravel-mix 0.8.* as I had that version in another project and the problem doesn’t occur, then I $ rm -rf node_modules && npm install laravel-mix -S and installed the latest version and the problem began to happen.

Note 2: The problem only occurs in $ npm run watch, $ npm run dev doesn’t delete it.

Note 3: I’ve not tested with a Laravel project, but I’m afraid it shouldn’t make a difference.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
JeffreyWaycommented, Jun 19, 2017

Fixed in 1.0.

0reactions
mediabeastnzcommented, Jun 14, 2017

Same issue for me - will downgrade and wait for stable 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maintain src/ folder structure when building to dist
The underlying reason is that one of my source files require d package.json at the root of the project. Once I removed that,...
Read more >
Tsconfig show typescript file not found error after moving it to ...
When I move a typescript file from a directory into another directory or delete the file from vscode, it shows a problem in...
Read more >
What is the role of src and dist folders in JavaScript/jQuery
The src stands for source. The /src folder comprises of the raw non-minified code. The /src folder is used to store the file...
Read more >
Output Management - webpack
Now run an npm run build and inspect the /dist folder. If everything went well you should now only see the files generated...
Read more >
gh-pages - npm
If a gh-pages branch already exists, it will be updated with all commits from the remote before adding any commits from the provided...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found