All Projects → module-federation → automatic-vendor-federation

module-federation / automatic-vendor-federation

Licence: MIT license
Utility to enable automatic vendor sharing within bundles using Module Federation

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to automatic-vendor-federation

Godot-Share
Simple share text and/or image module for Godot Engine (Android & iOS)
Stars: ✭ 58 (-15.94%)
Mutual labels:  share, module
Module Federation Examples
Implementation examples of module federation , by the creators of module federation
Stars: ✭ 979 (+1318.84%)
Mutual labels:  module, federation
shopyo
shopyo.readthedocs.org
Stars: ✭ 66 (-4.35%)
Mutual labels:  module
HttpsUtility
A basic HTTPS utility S# module.
Stars: ✭ 45 (-34.78%)
Mutual labels:  module
SocialSDK
iOS 实现sina(新浪)、wechat(微信)、qq(腾讯) 登录、分享功能,Share,ShareSDK,高仿友盟SocialSDK UI 实现,可自定义UI实现
Stars: ✭ 64 (-7.25%)
Mutual labels:  share
nuxt-ts-module
A tiny module to use Typescript within Nuxt.js application.
Stars: ✭ 21 (-69.57%)
Mutual labels:  module
maze generator
A work-in-progress Javascript maze generator module, compatible with both Deno and Node. 🌽
Stars: ✭ 35 (-49.28%)
Mutual labels:  module
A71-Hidden-Mods
A magisk module adding some mods to your Galaxy A71 systemlessly.
Stars: ✭ 16 (-76.81%)
Mutual labels:  module
ZfSnapGeoip
Maxmind Geoip module for Zend Framework 2
Stars: ✭ 15 (-78.26%)
Mutual labels:  module
puppetlabs-activemq
Puppet ActiveMQ Module
Stars: ✭ 25 (-63.77%)
Mutual labels:  module
Android-Resource-File-Provider
A simple library to easily provide and share files from app resources
Stars: ✭ 15 (-78.26%)
Mutual labels:  share
apollo-studio-community
🎡  GraphQL developer portal featuring an IDE (Apollo Explorer), auto-documentation, metrics reporting, and more. This repo is for issues, feature requests, and preview docs. 📬
Stars: ✭ 212 (+207.25%)
Mutual labels:  federation
Framer-Module-ShakeEvent
Shake event for your prototype.
Stars: ✭ 62 (-10.14%)
Mutual labels:  module
JB2A DnD5e
Templates of spells from the DnD5e ruleset (SRD and PHB), to use on FoundryVTT
Stars: ✭ 28 (-59.42%)
Mutual labels:  module
ogma
A monorepo for the ogma logger and related packages
Stars: ✭ 201 (+191.3%)
Mutual labels:  module
SnipWire
Full Snipcart shopping cart integration for ProcessWire CMF
Stars: ✭ 16 (-76.81%)
Mutual labels:  module
puppetlabs-xinetd
Module for managing entries in xinetd
Stars: ✭ 13 (-81.16%)
Mutual labels:  module
nim-mod
A Nim MOD player just for fun
Stars: ✭ 40 (-42.03%)
Mutual labels:  module
zscilib
An open-source scientific computing library for embedded systems running Zephyr OS or standalone.
Stars: ✭ 85 (+23.19%)
Mutual labels:  module
puppetlabs-docker
The Puppet Docker repository
Stars: ✭ 78 (+13.04%)
Mutual labels:  module

automatic-vendor-federation

Utility to enable automatic vendor sharing within bundles using Module Federation

This tool will be part of Webpack 5 core: webpack/webpack#10960

Check out our book

Practical Module Federation Book We will be actively updating this book over the next year as we learn more about best practices and what issues people are running into with Module Federation, as well as with every release of Webpack as it moves towards a release candidate and release. So with your one purchase you are buying a whole year of updates.

Install

yarn install @module-federation/automatic-vendor-sharing -D

Usage

There are a few arguments you can pass to the utility.

  • exclude : allows you to filter out any packages including part of the string.
  • packageJson : pass your apps package.json: eg: require("./package.json");
  • ignoreVersion: you can ignore versions on some shared packages. This utility supports versioned dependencies, which is a problem when using React as there can only be one version on the page
  • ignorePatchVersion : ignore patch numbers and share dependencies based on a minor version matching. lodash-4.11 instead of lodash-4.11.7
  • shareFrom: choose where in package.json the utility should share from. ['dependencies','peerDependencies']/ (default: dependencies)
const AutomaticVendorFederation = require("@module-federation/automatic-vendor-federation");
const { ModuleFederationPlugin } = require("webpack").container;
const packageJson = require("./package.json");
const exclude = ["babel", "plugin", "preset", "webpack", "loader", "serve"];
const ignoreVersion = ["react", "react-dom"];

module.export = {
  //... rest of your config
  plugins: [
    new ModuleFederationPlugin({
      name: "app2",
      library: { type: "var", name: "app2" },
      filename: "remoteEntry.js",
      remotes: {
        app1: "app1",
      },
      exposes: {
        Button: "./src/Button",
      },
      shared: AutomaticVendorFederation({
        exclude,
        ignoreVersion,
        packageJson,
        shareFrom: ["dependencies", "peerDependencies"],
        ignorePatchVersion: true,
      }),
    }),
  ],
};

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].