Skip to content

feat: make system config available as separate file #429

Closed

Description

@jeffbcross

I'm creating an App Shell broccoli plugin that needs to access a project's System config to properly load dependencies of an app component when pre-compiling. Right now, I would have to parse index.html to find the system configuration. Ideally, there would be a file I could import instead, i.e. system.config.json.

Activity

  1. jeffbcross commented on Apr 12, 2016

    @jeffbcross
    ContributorAuthor

    This also brings up another challenge, which is that my plugin doesn't know how to locate libraries being loaded via script tags instead of by System. I would have to manually augment the System configuration in my bundle to include angular, http, router, and rxjs.

  2. Brocco commented on Apr 13, 2016

    @Brocco
    Contributor

    Were you looking for more than just this:
    index.html

    <script src="system-config.js"></script>
    

    system-config.ts

    declare var System: any;
    
    System.config({
      packages: {
        app: {
          format: 'register',
          defaultExtension: 'js'
        }
      }
    });
    System.import('main.js').then(null, console.error.bind(console));
    
  3. jeffbcross commented on Apr 13, 2016

    @jeffbcross
    ContributorAuthor

    @Brocco in my case, that would work (except from the System.import included at the end, which would cause problems). It would be even better if the config could be a JSON file, so add-ons could inspect it and modify it before calling System.config

  4. self-assigned this
    on Apr 13, 2016
  5. Brocco commented on Apr 14, 2016

    @Brocco
    Contributor

    FYI, I have the separation into a separate file implemented in the style guide PR #427 but would be ideal if someone could go the extra step and get that into a JSON file

  6. Brocco commented on Apr 18, 2016

    @Brocco
    Contributor

    Resolved via #427

  7. angular-automatic-lock-bot commented on Sep 5, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions