Laravel-mix: Feature Request: Ability to disable mix-manifest.json generation.

Created on 17 Mar 2017  路  9Comments  路  Source: JeffreyWay/laravel-mix

Add ability to disable mix-manifest.json generation when using laravel-mix in non laravel projects.

It's a pain having to add extra tasks to remove the file all the time.

Possible syntax mix..version().disable()

Most helpful comment

Add these codes to webpack.mix.js:

// Disable mix-manifest.json
Mix.manifest.refresh = _ => void 0

All 9 comments

Why do you need to remove that file?

馃憤 I'm using mix outside Laravel and I have no use for the file. I'd great if we could just disable it's creation.

I'm using laravel-mix with the following frameworks/products:

  • magento
  • shopify

The manifest file is nuisance more than anything, hence low priority to this request.

This could be one of those tasks to do when you're having an off day and just need a quick win to get your on track. 馃憤 馃槃

You guys could update your npm script to rm public/mix-manifest.json after you trigger Webpack.

....

@sergeifilippov, @jerguslejko: Had the same problem, so I created and added this to my webpack.mix.js:

// Disable mix-manifest.json
(function(StatsWriterPlugin) {
  if (!StatsWriterPlugin) {
    return;
  }

  mix.plugins['StatsWriterPlugin'] = function(opts) {
    if (opts.filename === 'mix-manifest.json') {
      return {
        apply: function() {}
      };
    }
    return new StatsWriterPlugin(opts);
  };
}(mix.plugins['StatsWriterPlugin']));

I'm using mix outside Laravel and I have no use for the file

It's not specific to Laravel. It's a manifest that contains the names of the CSS and JS files, including a cache buster (https://www.npmjs.com/package/webpack-manifest-plugin). Most sites that use Webpack would be using it, unless you're also using some other CSS/JS combination/minification pipeline that does its own versioning.

This may be like beating a dead horse, but I'm using mix with the electron framework... it's not a problem, but it's annoying 馃憥

Add these codes to webpack.mix.js:

// Disable mix-manifest.json
Mix.manifest.refresh = _ => void 0
Was this page helpful?
0 / 5 - 0 ratings

Related issues

kpilard picture kpilard  路  3Comments

sdebacker picture sdebacker  路  3Comments

nezaboravi picture nezaboravi  路  3Comments

RomainGoncalves picture RomainGoncalves  路  3Comments

amin101 picture amin101  路  3Comments