Can't create webpack module with dependOn for import
See original GitHub issueHello. I would like to create three entry points with, on of them is shared.
I’m trying to use dependOn entry option. When i will have been added dependOn into entry, entry format changed.
Run code like this in my frontend application:
import * as X from 'module'; console.log(X);
And see for module with dependOn: :

Also for module without dependOn: :

I don’t understand, how to right use dependOn for share some code between entris, because when i use it, i will see the import problem described above. Anyone could help, and explain how do it right? I can contribute into examples.
My reproducible example - https://github.com/lavcraft/react-hooks-composition-in-webpack-entry-problem-example
PS: I’m tried differente entry.library.type - all produce different kind of errors. Screenshots above made with entry.library.type: ‘this’ for debug purposes.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)

Top Related StackOverflow Question
Usually what you should do is extract the shared part into a separate bundle, and then use
externalsto prevent it from being copied into other bundles.@lavcraft Why you need
dependOnfor libraries, I don’t see any reasons for that