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.

It is possible to extract vendor from multiple files ?

See original GitHub issue
  • Laravel Mix Version: 5.0.1 (npm list --depth=0)
  • Node Version (node -v):13.14.0
  • NPM Version (npm -v):6.14.5
  • OS:

Description:

Is it possible to extract the vendor from multiple files? I have multiple app.js files for each module and I want to extract the vendor like this.

mix.js('resources/js/admin/pages/user/user.js', 'public/js/admin/pages/user/').extract(['vue', 'jquery']);
mix.js('resources/js/admin/pages/role/role.js', 'public/js/admin/pages/role/').extract(['vue', 'jquery'];
mix.js('resources/js/admin/pages/product/product.js', 'public/js/admin/pages/product/').extract(['vue', 'jquery'];

Steps To Reproduce:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
robertotcestaricommented, Jun 17, 2020

This would be useful if we need to separate backend from frontend js.

0reactions
G3zcommented, Aug 30, 2021

I’m still struggling with this :

My solution is to create 2 files webpack.admin.mix.js and webpack.mix.js

I also edited npm scripts like so

"development": "mix && mix --mix-config webpack.admin.mix",
"production": "mix --production && mix --mix-config webpack.admin.mix --production"

not very elegant but it works

Read more comments on GitHub >

github_iconTop Results From Across the Web

It is possible to extract vendor from multiple files ?
Is it possible to extract the vendor from multiple files? I have multiple app.js files for each module and I want to extract...
Read more >
Extracting Vendor Files - YouTube
See the thread on XDA: https://forum.xda-developers.com/android/general/guide-intermediate-to-advanced-custom-t3823927Or on my website: ...
Read more >
Multiple vendors from extract · Issue #488 · laravel-mix ...
I have a problem with extracting to multiple vendors, which is possible since roughly a month? For example I want to extract to ......
Read more >
In Laravel Mix, is it possible to extract all vendors except a ...
From Laravel Mix v6 (released Dec 21, 2020), you can have multiple vendor files: mix.extract(['vue','lodash','axios'], 'vendor-main.js'); ...
Read more >
How can extract vendor data
How can extract vendor data. ... Company account and run....u will get balances of all the vendors of that company. Now go to...
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