question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bundle multiple apps together?

See original GitHub issue

Where I work we are using create-react-app for all our applications. These apps are linked together so that one user may actually move from one to the other quite often.

It’s not optimal but this allowed us to have independent teams work on different apps and have them integrate with each-others.

Now we’d like to reduce the amount of data the user has to download to use all our applications. The problem we see is that each time the user switches from one app to the other, she will have to download all the dependencies again, even the ones she had downloaded to run the previous app (react, react-dom, and any common dependency).

I’m now wondering if there could be a way to have multiple create-react-app apps built together by the same webpack build, with one entry point for each app, and as output a set of index.html (one for each app), plus the bundles of each app, and the common dependencies bundled in other bundles that could be shared across them.

- applications
  - CRA1
  - CRA2
- builds
  - CRA1
    - index.html
    - bundle.js
  - CRA2
    - index.html
    - bundle.js
  - common.js

I tried to work on this in my time and the first problem I faced was that since we used the NODE_PATH env variable on all our apps, we needed a way to make webpack properly resolve those paths.

The result is this small custom resolver: https://github.com/FezVrasta/webpack-context-relative-resolver/blob/master/README.md

I was wondering what are your thoughts about this use case and if you’d like to see this progress.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Feb 9, 2018

I don’t really see us supporting this directly.

The closest you can get to this with a CRA setup is to extract independent parts to have their own build system (e.g. using nwb. Then you can host them at some CDN, and put them into index.html of the CRA projects.

I don’t have a better solution that doesn’t also involve ejecting (and at that point it’s more of a webpack question so I direct you to them instead).

0reactions
bugzpoddercommented, Jun 29, 2018

Correct, It does not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Bundles - App Store - Apple Developer
App bundles make it easy for customers to buy up to 10 of your apps or games in a single purchase. You can...
Read more >
macos - Multiple applications in a single bundle - Stack Overflow
Is it possible to have multiple applications inside a single application bundle or do I have store the editor and viewer components as ......
Read more >
Solved: Combining Multiple PowerApps Together
If you want to combine multiple apps within PowerApps, I agree with the second option that you mentioned almost. You could consider take...
Read more >
Ninite - Install or Update Multiple Apps at Once
The easiest, fastest way to update or install software. Ninite downloads and installs programs automatically in the background.
Read more >
About Android App Bundles
An Android App Bundle is a publishing format that includes all your app's compiled code and resources, and defers APK generation and signing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found