Giter Site home page Giter Site logo

Comments (1)

joeldenning avatar joeldenning commented on September 27, 2024

I hope you are able to find a good solution for those angular applications.

Regarding the issue you reported, see related single-spa/single-spa-angular#59 which talks about the assets in angular.json.

The behavior you are seeing is known/expected behavior, as we brainstorm better solutions.

With single-spa, there is only one HTML file, instead of one per angular application. Which means that the scripts and assets in the angular.json don't have a perfect way to be injected into the HTML like they would if there were a separate HTML file for each.

Options for you:

  1. Add deepstream and echarts into the root html file (preferred). Use a CDN like cdnjs or jsdelivr, which have both of those libraries.
  2. Add import 'echarts/dist/echarts.min.js' (and similar for deepstream) into your main.single-spa.ts file. Which includes them into your javascript bundle instead of in the HTML file.
  3. Use a partial webpack config and add deepstream and echarts as webpack externals. Make the externals be loaded from the CDN and then import them with import 'echarts' and import 'deepstream':
// in your partial webpack config
{
  externals: {
    "deepstream": "https://jsdelivr.com/...",
    "echarts": "https://jsdelivr.com/..."
  }
}

I'm closing this since I think I've explained how it is known/expected behavior. If you have better ideas for how the scripts/assets from angular.json would be loaded, feel free to reopen or propose a change to single-spa-angular.

from coexisting-angular-microfrontends.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.