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.

Feature request - multiple vendor/manifest files

See original GitHub issue

I have read quite a few “issues” (https://github.com/JeffreyWay/laravel-mix/issues/197 & https://github.com/JeffreyWay/laravel-mix/issues/488) on here and I would like to make a feature request to solve this.

I find it very useful to have multiple entry points / vendor file extractions, for use cases such as backend and frontend assets extraction.

Simple example

// Mix backend resources.
mix.js('resources/assets/backend/js/app.js', 'public/backend/js')
    .extract(['vue', 'vuetify']);

// Mix frontend resources.
mix.js('resources/assets/js/app.js', 'public/js')
    .extract(['jquery', 'bootstrap']);

Currently (with Laravel Mix 1.2.0), the mix-manifest.json file would look like this:

{
    "/backend/js/app.js": "/backend/js/app.js",
    "/js/vendor.js": "/js/vendor.js",
    "/js/app.js": "/js/app.js",
    "/js/manifest.js": "/js/manifest.js",
}

The output should be as follows:

{
    "/backend/js/vendor.js": "/backend/js/vendor.js",
    "/backend/js/app.js": "/backend/js/app.js",
    "/backend/js/manifest.js": "/backend/js/manifest.js",
    "/js/vendor.js": "/js/vendor.js",
    "/js/app.js": "/js/app.js",
    "/js/manifest.js": "/js/manifest.js",
}

I would love to see this included, because in my case I actually even have 3 entry points. Haha

Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:48
  • Comments:22 (4 by maintainers)

github_iconTop GitHub Comments

32reactions
VinceGcommented, Nov 27, 2018

@ievgenklymenko Just have two separate webpack.mix.js file.

package.json

    "dev": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "server": "npm run dev -- --env.mixfile=server.mix",
    "client": "npm run watch -- --env.mixfile=client.mix",

server.mix.js

let mix = require("laravel-mix");
let distPath = "public/js/server";

mix.react('resources/assets/js/frontend/app-server.js', distPath)
  .webpackConfig({ target: 'node' })
  .disableNotifications()
  .sourceMaps()
  .setPublicPath(distPath)
  .setResourceRoot("/");

if (mix.inProduction()) {
  mix.version();
}

client.mix.js

let mix = require("laravel-mix");
let distPath = "public/js/client";

mix.react('resources/assets/js/frontend/app-client.js', distPath)
  .webpackConfig({ target: 'web' })
  .disableNotifications()
  .sourceMaps()
  .setPublicPath(distPath)
  .setResourceRoot("/");

if (mix.inProduction()) {
  mix.version();
}
17reactions
omnichronouscommented, Jul 14, 2017

Here is one way to achieve this right now - https://github.com/omnichronous/multimix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request - multiple vendor/manifest files · Issue #989
I find it very useful to have multiple entry points / vendor file extractions, for use cases such as backend and frontend assets...
Read more >
Manifests | Android Open Source Project
This setup enables multiple products with the same board to share the same vendor image (which provides common HALs) yet have different ODM ......
Read more >
Use an Input Manifest File - Amazon SageMaker
Each line in an input manifest file is an entry containing an object, ... Use the source key for single and multi-label text...
Read more >
The Manifest - webpack
Any third-party library or "vendor" code your source is dependent on. A webpack runtime and manifest that conducts the interaction of all modules....
Read more >
Web Application Manifest - W3C
This specification defines a JSON-based file format that provides ... to appear in a manifest, some user agents might require one or more...
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