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.

Mix does not delete old versioned files when a new one is generated

See original GitHub issue
  • Laravel Mix Version: 0.11.4
  • Node Version: v6.10.0
  • NPM Version: 3.10.10
  • OS: Windows 7 Ultimate 64x

Description:

When I’m using the version() function, it doesn’t matter if I’m running in production mode or not, the old versioned files are not been deleted (BTW this is not a Laravel project) oij8jp6 1

Steps To Reproduce:

Put this setting in the webpack.mix.js 30d441f4-3aba-11e7-8472-4e598bca6e04 1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:56 (23 by maintainers)

github_iconTop GitHub Comments

12reactions
ankurk91commented, Jun 5, 2017

@warrio4 Things has changed since my comment. I would suggest to use clean-webpack-plugin

  • Install clean-webpack-plugin
npm i clean-webpack-plugin --save-dev
  • Update your webpack-mix.js
const mix = require('laravel-mix');
const CleanWebpackPlugin = require('clean-webpack-plugin');
// Your mix setup may goes here
// mix.js(....)

// Add this to very bottom of your webpack-mix.js
mix.webpackConfig({
  plugins: [
    new CleanWebpackPlugin(['./public/js', './public/css', './public/fonts'])
  ]
});

This plugin play nice even in watch mode.

8reactions
ruchernchongcommented, Jun 7, 2017

@boyd91 0.11.4 is the most stable at the moment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mix does not delete old versioned files when a new one is ...
Yes, i can reproduce the issue, mix does not delete files if output folder is other than default (public/js). There are two possible...
Read more >
Laravel mix versioning doesn't remove old built files
In a new project I started, I do not have this issue. Mix correctly replaces the old file with the latest built version....
Read more >
Deleting object versions from a versioning-enabled bucket
To delete versioned objects permanently, you must use DELETE Object versionId . The following figure shows that deleting a specified object version permanently ......
Read more >
How versioning works in lists and libraries
When versioning is enabled in a list or library, you can store, track, and restore items in a list and files in a...
Read more >
Version Stacking and comparison
A: Yes, all assets types can be stacked with another asset of the same type. Q: Can I mix asset types in a...
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