question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack 5 / Module Federation

See original GitHub issue

Description

Webpack 5 has a new feature called Module Federation (I’m sure it’s caught some folks’ attention by now), allowing you to at runtime import parts of bundles from other applications. I could see this slotting into nx quite neatly, for example by allowing the exposes property of the plugin to be set in nx.json:

{
  "projects": {
    "chrome": {
      "exposes": {
        "AppContainer": "src/App.tsx"
      },
      "tags": []
    },
    "chrome-e2e": {
      "tags": [],
      "implicitDependencies": ["chrome"]
    },
    "settings": {
      "tags": [],
      "exposes": {
        "Settings": "src/Settings.tsx"
      }
    }
  }
}

I tried looking for an existing issue but couldn’t find any, so thought it would be worth bringing up. Would love to hear what you think about Module Federation in general, and what it could mean for NX. Thanks ❤️

Some links:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:64
  • Comments:36 (6 by maintainers)

github_iconTop GitHub Comments

35reactions
cratescommented, May 13, 2021

@firxworx / @vitorcamachoo / @agoncharuks / @georgewilde / @elenasch / @vanuj:

Webpack 5 is on the Nx roadmap, slated for release with version 13 in October of this year.

11reactions
smasalacommented, Jul 8, 2020

Agree with @Vynlar. This would be a huge game changer in terms of creating isolated buildable and deployable apps which can then be part of a single and larger SPA.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module Federation - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Building micro-frontends with webpack's Module Federation
Learn to simplify app architecture by using webpack 5's Module Federation to consume and share micro-frontend components with a Vue example.
Read more >
Webpack 5 module federation for Micro-frontend Architecture
Webpack 5 module federation is a way provided by Webpack team to load multiple micro applications(remote applications) into another application(host ...
Read more >
Module Federation
The Practical Guide to Module Federation. "Practical Module Federation" is the first, and only, book on Webpack 5's innovative new live code sharing...
Read more >
What Is Webpack Module Federation and Why Does It Matter?
Module Federation is one of the most exciting features in Webpack 5 and is considered a game-changer in JavaScript architecture.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found