Skip to content

Commit

Permalink
chore: fix package name (#6)
Browse files Browse the repository at this point in the history
* chore: fix package name

* chore: fix package name

* add FUNDING.yml

* adding gitignore on locks
  • Loading branch information
ScriptedAlchemy authored Oct 25, 2020
1 parent a54de41 commit 54627ca
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: [ScriptedAlchemy]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ dist
# TernJS port file
.tern-port
/.idea/
/yarn.lock
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nextjs-with-module-federation
Module Federation For Next.js
====================================

This plugin enables Module Federation on Next.js
Expand Down Expand Up @@ -55,11 +55,11 @@ module.exports = {
};
```

2. Add the `sharePatch` to `_document.js`. This will solve the react sharing issue.
2. Add the `patchSharing` to `_document.js`. This will solve the react sharing issue.

```jsx
import Document, { Html, Head, Main, NextScript } from "next/document";
import { sharePatch } from "@module-federation/nextjs-with-module-federation";
import { patchSharing } from "@module-federation/nextjs-with-module-federation";

class MyDocument extends Document {
static async getInitialProps(ctx) {
Expand All @@ -70,7 +70,7 @@ class MyDocument extends Document {
render() {
return (
<Html>
{sharePatch()}
{patchSharing()}
<script src="http://localhost:3000/_next/static/chunks/webpack.js" />
<script src="http://localhost:3000/_next/static/runtime/remoteEntry.js" />
<Head />
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"name": "@module-federation/nextjs-with-module-federation",
"name": "@module-federation/nexjs-mf",
"version": "1.0.0",
"description": "Module Federation helper for NextJS",
"main": "index.js",
"repository": "https://github.com/module-federation/nextjs-with-module-federation",
"repository": "https://github.com/module-federation/nexjs-mf",
"author": "Zack Jackson <[email protected]>",
"license": "MIT",
"scripts": {
"prettier": "prettier --write \"**/*.{js,json,md,ts,tsx}\""
},
"devDependencies": {
"prettier": "2.1.2"
"prettier": "^2.1.2",
"react": "^17.0.1"
},
"peerDependencies": {
"react": "^16 || ^17"
}
}
2 changes: 1 addition & 1 deletion withModuleFederation.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const withModuleFederation = (config, options, mfConfig) => {
};
} else {
config.externals = {
react: path.resolve("./react.js"),
react: path.resolve(__dirname, "./react.js"),
// "react-dom": path.resolve("./react-dom.js"),
};
}
Expand Down
8 changes: 0 additions & 8 deletions yarn.lock

This file was deleted.

0 comments on commit 54627ca

Please sign in to comment.