How to deploy nextjs Module federation plugin to netlify & vercel
![Fiona Paul](https://cdn.sanity.io/images/pjqiaql6/production/13760d3ab01ec9bd3674d65c78a7533a6624db24-6016x4016.jpg)
Fiona Paul
![Cover Image for How to deploy nextjs Module federation plugin to netlify & vercel](https://cdn.sanity.io/images/pjqiaql6/production/7f28c52614c50e74144c77aa3eb3c16de8be7721-1600x869.png?w=1240)
![Fiona Paul](https://cdn.sanity.io/images/pjqiaql6/production/13760d3ab01ec9bd3674d65c78a7533a6624db24-6016x4016.jpg)
Fiona Paul
Steps to install club greensock packages in netlify
- Add a file named
.npmrc
to the project root with the following contents in it:
always-auth=true
save-exact=true
@module-federation:registry=https://r.privjs.com
//r.privjs.com/:_authToken=${PRIVJS_TOKEN}
If you are running the app in the dev environment, replace ${PRIVJS_TOKEN}
with the token provided to you by PrivJs
- Install the package using the following command:
$ npm i @module-federation/nextjs-mf
if you are using yarn package manager then you need to run:
$ yarn add @module-federation/nextjs-mf
- Now you need to add the
PRIVJS_TOKEN
value to your environment variables in netlify site settings:
Or on Vercel site settings:
That's it! If you face any issues, write to us at support@privjs.com
and we would be happy to help you.