Multiple versions of the same JS library with Bower and django pipeline

Two of the libraries that I use in my single page application are moment and backgrid-moment-cell . I use bower to manage my external libraries and django-pipeline to pack assets.

I would like to use version 2.8.1 of the moment, but backgrid-moment-cell requires version ~ 2.5.0. How can I get both versions in a project?

+2
source share
1 answer

Front-end development should use one dependency because you want to minimize the amount of code that your users need to download. Bower helps you deal with this, which is the main advantage of using it. You have several options:

  • The manual module namespace then includes both (really not recommended)
  • Use resolutionsin bower.json, but you can enter errors:
"resolutions": {
    "moment": "2.8.1"
}
  • Contact your maintainer to discard dependency versions on baur (recommended)
0
source

Source: https://habr.com/ru/post/1546824/


All Articles