Webpack loads 2 versions of backbone instead of 1
See original GitHub issueWhen I have a structure like this:
├─┬ node_modules
│ ├── backbone@1.2.1
│ ├─┬ backbone.marionette@2.4.1
│ │ └─┬ node_modules
│ │ ├── backbone@1.1.2
│ │ └── backbone.babysitter@0.1.7
│ └── backbone.babysitter@0.1.7
└── app.js
And load these modules in my app.js like this:
import Backbone from "backbone";
import Marionette from "backbone.marionette";
import "backbone.babysitter";
Now when I watch in dev tools at the sources tab, it show that the page has loaded 2 backbones and 2 backbone.babysitters. First the self defined versions, and secondly the dependencies of Marionette:
How can I ensure that webpack provides the self defined packages to Marionette?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Use backbone 1.2.0 · Issue #2559 - GitHub
Loading Marionette with Webpack bundles 3 different versions of Backbone and 2 versions of Underscore. backbone.babysitter:.
Read more >Old Backbone & Marionette built with webpack - Stack Overflow
I'm trying to add "webpack" build to an old project with backbone and ... matter if I load my own backbone, as it...
Read more >BackboneJS with Webpack: A lesson in optimization
Webpack is a module bundler primary goal is to limit initial loading time. See how to use it, and what it's good for,...
Read more >Plugins - webpack
Plugins are the backbone of webpack. Webpack itself is built on the same plugin system that you use in your webpack configuration! They...
Read more >From Require.js to Webpack — Part 2 (The How) - Medium
It wraps the library and exports the value of the Backbone variable. It makes sure that when evaluated backbone has access to both...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This workaround seems to work well. You probably have to careful about version conflicts though.
This issue can be closed now right @sokra?