laravel-mix-merge-manifest
laravel-mix-merge-manifest copied to clipboard
Needs some examples
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.
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"
}
You should put the example in the readme file, I find this very useful
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
No u don't, its suitable if u have multiple package.json, ex: Backend/Front
by default laravel mix delete
mix-manifest.jsonfile on every build, this plugin replace this behavior and allows you to have multiplewebpack.mix.jsI made this originally for
nwidart/laravel-modulesand 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