Skip to content

Instantly share code, notes, and snippets.

@fczbkk
Created May 23, 2020 05:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fczbkk/4762412a66710b9d9262f1e95ca474d7 to your computer and use it in GitHub Desktop.
Save fczbkk/4762412a66710b9d9262f1e95ca474d7 to your computer and use it in GitHub Desktop.
Multiple versions of same library in Webpack
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)
{
"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