# external-remotes-plugin

> **Host webpack.config** ```js const config = { ...otherConfigs plugins: [ new ModuleFederationPlugin({ name: "app1", remotes: { app2: "app2@[window.app2Url]/remoteEntry.js" } }). new ExternalTemplateRemotesPlugin(), ] } ```

Latest version **1.0.0** (published 2021-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install external-remotes-plugin
pnpm add external-remotes-plugin
yarn add external-remotes-plugin
bun add external-remotes-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-06-08 |
| First published | 2021-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zack Jackson |
| Maintainers | zackljackson |

## Links

- npm: https://www.npmjs.com/package/external-remotes-plugin
- Repository: git@github.com:module-federation/external-remotes-plugin
- npm.io page: https://npm.io/package/external-remotes-plugin

## Dependencies (1)

- [webpack-sources](https://npm.io/package/webpack-sources.md) ^2.2.0

## Recent versions

- 1.0.0 (latest) — 2021-06-08

## README

# external-remotes-plugin

**Host webpack.config**
```js
const config = {
   ...otherConfigs
  plugins: [
    new ModuleFederationPlugin({
      name: "app1",
      remotes: {
        app2: "app2@[window.app2Url]/remoteEntry.js"
      }
    }).
    new ExternalTemplateRemotesPlugin(),
  ]
}
```

or

```js
plugins: [
    new ModuleFederationPlugin({
        name: 'my-app',
        remotes: {
            'my-remote-1': 'my-remote-1@[window.remote-1-domain]/remoteEntry.js?[getRandomString()]',
            ...
        },
        shared: {...}
    }),
    new ExternalTemplateRemotesPlugin(), //no parameter,
]
```

**Host (app1) source somewhere before loading main entry file**
```js
window.app2Url = "//localhost:3002"; // Whatever the url/logic to determine your remote module is

import("./bootstrap");
```

Working example is also available in this PR: https://github.com/module-federation/module-federation-examples/pull/557.

**Update:** the PR was merged a example can be found under [advanced-api/dynamic-remotes-synchronous-imports](https://github.com/module-federation/module-federation-examples/tree/d5cf265c2d4fd040797cbae806badd8267ad5b8f/advanced-api/dynamic-remotes-synchronous-imports)

---
_Source: https://npm.io/package/external-remotes-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
