Skip to content

Commit

Permalink
update docs a little
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy committed Jun 21, 2021
1 parent 2cf76e6 commit 1205389
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# common-3rd-parties
Common Third party scripts provided as federated modules


Allows for importing of third parties via module federation

## Configuring the consumer
```js
new ModuleFederationPlugin({
name: "app1",
remotes: {
"@module-federation/common-3rd-libs": `moduleFederationCommon_3rdLibs@https://unpkg.com/@module-federation/[email protected]/dist/browser/remote-entry.js`,
},
shared: { react: { singleton: true }, "react-dom": { singleton: true } },
})
```


## Examples:
```js
import("@module-federation/common-3rd-libs/google-analytics").then((ga) => {
ga("create", "UA-XXXXX-Y", "auto");
ga("send", "pageview");
});
import("@module-federation/common-3rd-libs/facebook").then((fbq) => {
console.log(fbq);
fbq("init", "12341234");
fbq("track", "PageView");
});
import("@module-federation/common-3rd-libs/bing").then((UET) => {
console.log(UET);
var o = { ti: "TAG_ID_HERE" };
window.uetq = new UET(o);
window.uetq.push("pageLoad");
});
```

0 comments on commit 1205389

Please sign in to comment.