should Webpack pack from remote resource?

... building box for us to share code

how does box manage dependencies?

  • parse all import statements

  • maintain a box.json

webpack loader

first of all, it's not a Webpack loader

webpack building blocks

  • compiler

  • compilation

  • resolver

  • module

  • loader

it's a Webpack resolver

resolvers handle where to find files

Webpack tapable

Webpack
Enhanced Resolve

Resolver plugins

An aged discussion

https://github.com/webpack/webpack/issues/150

In short: it's not a Webpack job

Val Loader

  • takes in a bundle that dynamically resolves to some code
  • resolution of that bundle remains static

Remote Resolver

Module federation & code sharing between bundles

https://github.com/webpack/webpack/issues/10352

What we can do now?

demos

demo & explain

  • build packages that fetch remote sources
  • same hash means same code -> really easy caching

further questions

  • what does it imply for HMR?
  • how to load those bundles?

what does it imply if webpack and pack from remote source

By Wei Gao

what does it imply if webpack and pack from remote source

  • 512