You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per discussion on single-spa slack with @yww325, it seems that it'd be relatively easy to incorporate standalone-single-spa-webpack-plugin to enable standalone mode for Angular applications, like other create-single-spa generated applications have. I'm copying the conversation here (with my own formatting added) for posterity and reference:
ok, I figured it out, need to pnpm install two packages
(can't use latest version due to a tag async issue)
then use a default main.ts like below and include it in tsConfig and set as the main entry point of angular build.
I'm opening this issue knowing that I don't know Angular/angular-cli internals. This seems like a good feature to add but we need community help to implement and test.
In what way would you use it?
Projects generated with create-single-spa should have this feature incorporated. Projects that trigger this plugin (eg. ng add single-spa) could either have it automatically generated or should prompt to add.
Initial requirements
Relevant packages should be installed using Angular schematic
Should this be optional? If so the schematic would need to handle prompting user.
Should this be handled in create-single-spa instead? I'd think not but Angular is unfamiliar territory.
How to validate angular-cli underlying library compatibility? In other words, how can we be sure that the version(s) of webpack used by angular-cli is compatible with this plugin and configuration? If not how to handle gracefully?
How to test/validate across all versions of angular-cli?
The text was updated successfully, but these errors were encountered:
Should this be optional? If so the schematic would need to handle prompting user.
I think that standalone mode should just be another script in the package.json, similar to what we've done with other projects. npm run serve starts integrated mode, npm run serve:standalone starts standalone mode.
Should this be handled in create-single-spa instead? I'd think not but Angular is unfamiliar territory.
This should be done in single-spa-angular, not create-single-spa. All that create-single-spa does is defer to Angular CLI and single-spa-angular. The single-spa-angular project controls the webpack configuration (including adding plugins like the standalone plugin) and also has the ability to modify the package.json to add new scripts.
How to validate angular-cli underlying library compatibility? In other words, how can we be sure that the version(s) of webpack used by angular-cli is compatible with this plugin and configuration? If not how to handle gracefully?
You can detect which version of angular is installed via something similar to import { version } from '@angular/core'. However, the single-spa-angular project maintains different major versions for different versions of Angular, so we might need to do that since the latest version of single-spa-angular only works with the latest versions of Angular.
How to test/validate across all versions of angular-cli?
I don't think we'd need to support all versions of angular cli
Description of Proposed Feature
Per discussion on single-spa slack with @yww325, it seems that it'd be relatively easy to incorporate standalone-single-spa-webpack-plugin to enable standalone mode for Angular applications, like other create-single-spa generated applications have. I'm copying the conversation here (with my own formatting added) for posterity and reference:
Community contribution for this is needed
I'm opening this issue knowing that I don't know Angular/angular-cli internals. This seems like a good feature to add but we need community help to implement and test.
In what way would you use it?
Projects generated with create-single-spa should have this feature incorporated. Projects that trigger this plugin (eg.
ng add single-spa
) could either have it automatically generated or should prompt to add.Initial requirements
Remaining questions
The text was updated successfully, but these errors were encountered: