main-client.js vs vendor.js #641

Closed
opened 2025-08-09 17:17:04 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @aherrick on 6/22/2017

Trying to get an understanding what the difference is and how these work with webpack.

Let's say I have a library I want to bring in. In this case sweetalert2 https://github.com/limonte/sweetalert2

I then import that into my package.json as "sweetalert2": "^6.6.5"

Now inside a component I can simply reference like so: import swal from 'sweetalert2'; Everything works fine and sweetalert2 is imported into my main-client.js

What is the need to add that to the vendor.js via webpack? Is that the 'main-client.js' is built up on the fly vs the vendor.js which is built at compile time? I must be missing something here.

*Originally created by @aherrick on 6/22/2017* Trying to get an understanding what the difference is and how these work with webpack. Let's say I have a library I want to bring in. In this case `sweetalert2` https://github.com/limonte/sweetalert2 I then import that into my `package.json` as ` "sweetalert2": "^6.6.5"` Now inside a component I can simply reference like so: `import swal from 'sweetalert2';` Everything works fine and `sweetalert2` is imported into my `main-client.js` What is the need to add that to the `vendor.js` via webpack? Is that the 'main-client.js' is built up on the fly vs the `vendor.js` which is built at compile time? I must be missing something here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#641
No description provided.