You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to bundle vendor scripts separately and require them as needed with Webpack? #1087
Maybe this is not the right place to ask this, but I'm really in need of help here. I posted this question on stackoverflow yesterday, could you please have a look at it?
@bebraw In the end I decided to keep doing it as before... I use webpack for my own scripts, and I merge all vendor scripts into one even if some of them are not used. I don't like it, but it works... I tried to create a loader to just grab all required vendor scripts and merge them in a file by keeping global variables, but it had some problems with the order files were being loaded and written. I ended up giving up because it was consuming too much time. If you want to have a look you can find it here: https://github.com/bensampaio/webpack-globals-loader.
Activity
margielm commentedon May 20, 2015
I don't consider myself webpack-expert. but I tried to do my best to help you.
bebraw commentedon Nov 14, 2015
@bensampaio Did you figure this out?
bensampaio commentedon Nov 21, 2015
@bebraw In the end I decided to keep doing it as before... I use webpack for my own scripts, and I merge all vendor scripts into one even if some of them are not used. I don't like it, but it works... I tried to create a loader to just grab all required vendor scripts and merge them in a file by keeping global variables, but it had some problems with the order files were being loaded and written. I ended up giving up because it was consuming too much time. If you want to have a look you can find it here: https://github.com/bensampaio/webpack-globals-loader.
Freezystem commentedon Apr 19, 2016
In case you're interested in bundling automatically your scripts separately from vendors ones:
You can read more about this feature in official documentation.
KongMac commentedon Apr 19, 2016
You can put the vendor scripts into the other folder,not in the entry folders.you just use "require (XX)"in the entry file,and then you make it.