Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared module not working when cherry picking #51

Open
bchoddny opened this issue Aug 11, 2021 · 0 comments
Open

Shared module not working when cherry picking #51

bchoddny opened this issue Aug 11, 2021 · 0 comments

Comments

@bchoddny
Copy link

bchoddny commented Aug 11, 2021

I'm trying to cherry pick lodash module. In the module federation plugin configuration, i tried to share this module, but I noticed multiple instance of lodash is loaded, when hosting remote component. My understanding was, if remote component has lodash as dependency, it wont be loaded twice, if specified as shared. Does sharing works when cherry picking modules in a library? if not, what are the other options? Please advise.

import has from 'lodash/has';

My webpack module federation configuration:

const { ModuleFederationPlugin } = require('webpack').container;
module.exports = {
plugins: [
new ModuleFederationPlugin({
// adds lodash as shared module
// version is inferred from package.json
// there is no version check for the required version
// so it will always use the higher version found
shared: ['lodash'],
}),
],
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant