Reader small image

You're reading from  Building Micro Frontends with React 18

Product typeBook
Published inOct 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781804610961
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Vinci J Rufus
Vinci J Rufus
author image
Vinci J Rufus

Vinci Rufus is a VP for technology at Publicis Sapient. He has spent over 25 years building web applications using various technologies. He has been focused on building micro frontends for about half a decade and has successfully built and managed micro frontend-based applications for a few large clients. He was formerly a Google Developer Expert and has had the opportunity to speak at numerous conferences on modern frontend and cloud-native technologies.
Read more about Vinci J Rufus

Right arrow

Creating the Microfrontend Production build

As you may recollect, so far, we’ve only run and tested our microfrontends in development mode, using the nx serve command. For us to deploy applications to a hosting server, they need to be built in production mode.

This is usually quite straightforward in regular React apps, but with our microfrontends, it needs a bit more work.

Open up the ebuy app we built in Chapter 5 and follow these steps. Let's first create a script command to build all our apps:

  1. Open up the package.json file on the root and just like the serve:all command, let's create a new command for build:all as follows:
    "build:all": "nx run-many --target=build"
  2. Run the pnpm build:all command and let us see whether all the apps build. Oops! You’ll notice while all the other apps built fine, app-shell threw out some error about not being able to find catalog/Module or checkout/Module, and so on.

    Let's dig a bit into...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Building Micro Frontends with React 18
Published in: Oct 2023Publisher: PacktISBN-13: 9781804610961

Author (1)

author image
Vinci J Rufus

Vinci Rufus is a VP for technology at Publicis Sapient. He has spent over 25 years building web applications using various technologies. He has been focused on building micro frontends for about half a decade and has successfully built and managed micro frontend-based applications for a few large clients. He was formerly a Google Developer Expert and has had the opportunity to speak at numerous conferences on modern frontend and cloud-native technologies.
Read more about Vinci J Rufus