Created
May 23, 2020 05:38
-
-
Save fczbkk/4762412a66710b9d9262f1e95ca474d7 to your computer and use it in GitHub Desktop.
Multiple versions of same library in Webpack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import modernJquery from 'modernJquery' | |
import legacyJquery from 'legacyJquery' | |
console.log('Look how much Jquery we can pack into single bundle!') | |
// 3.x.x | |
console.log('This is Jquery version:', modernJquery().jquery) | |
// 2.x.x | |
console.log('This is Jquery version:', legacyJquery().jquery) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "moar-jquery", | |
"version": "1.0.0", | |
"dependencies": { | |
"modernJquery": "npm:jquery@^2.0.0", | |
"legacyJquery": "npm:jquery@^3.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment