a--m
a--m

Reputation: 4782

Can webpack bundle different versions of the same dependency

I've a project made of different widgets that all share the same vendor. I would like to know if I could bundle different versions of the same vendor library:

widget A

widget B

bundle

Upvotes: 5

Views: 3359

Answers (1)

Ted Fitzpatrick
Ted Fitzpatrick

Reputation: 948

So I found that NPM provides a way to alias the names of modules/libraries upon installation. I tested this and it works great, and the 2 versions of jQuery are even bundled in the same vendors.bundle by Webpack. Here's the module alias syntax:

npm install jquery2@npm:jquery@2
npm install jquery3@npm:jquery@3

Upvotes: 5

Related Questions