laravel-mix-merge-manifest icon indicating copy to clipboard operation
laravel-mix-merge-manifest copied to clipboard

Needs some examples

Open josegus opened this issue 6 years ago • 5 comments

Currently i need to have two manifest (dev and prod). Maybe this package could help, but i think we need more documentations about how it works.

josegus avatar Jul 28 '19 03:07 josegus

by default laravel mix delete mix-manifest.json file on every build, this plugin replace this behavior and allows you to have multiple webpack.mix.js

I made this originally for nwidart/laravel-modules and I'm using it in this project (wip)

Other resources:

  • https://github.com/omnichronous/multimix
  • http://www.compulsivecoders.com/tech/how-to-build-multiple-vendors-using-laravel-mix/

You can try overriding some Mix settings:

const mix = require('laravel-mix');

if (mix.inProduction()) {
    Mix.manifest.name = "mix-manifest.prod.json"
} else {
    Mix.manifest.name = "mix-manifest.dev.json"
}

KABBOUCHI avatar Jul 28 '19 10:07 KABBOUCHI

You should put the example in the readme file, I find this very useful

josegus avatar Feb 04 '20 15:02 josegus

So, in resume, what this plugin does is:

  • give you the ability to use multiple webpack.mix.js, right?

If i want to use multiple manifest (prod and dev), I don't need the plugin

josegus avatar Feb 04 '20 16:02 josegus

No u don't, its suitable if u have multiple package.json, ex: Backend/Front

KABBOUCHI avatar Feb 04 '20 16:02 KABBOUCHI

by default laravel mix delete mix-manifest.json file on every build, this plugin replace this behavior and allows you to have multiple webpack.mix.js

I made this originally for nwidart/laravel-modules and I'm using it in this project (wip)

Other resources:

  • https://github.com/omnichronous/multimix
  • http://www.compulsivecoders.com/tech/how-to-build-multiple-vendors-using-laravel-mix/

You can try overriding some Mix settings:

const mix = require('laravel-mix');

if (mix.inProduction()) {
    Mix.manifest.name = "mix-manifest.prod.json"
} else {
    Mix.manifest.name = "mix-manifest.dev.json"
}

I have read those blog post and now i understand how your package works. Nice.

But i'm facing a different problem: how can I have two different manifest (backoffice and store) and use mix to load the manifest depending on backoffice or store blade frontend?

I know i can pass the path, but still dont get it how to make it work

josegus avatar Feb 05 '20 23:02 josegus