Skip to content

feat: make system config available as separate file #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeffbcross opened this issue Apr 12, 2016 · 6 comments
Closed

feat: make system config available as separate file #429

jeffbcross opened this issue Apr 12, 2016 · 6 comments
Assignees

Comments

@jeffbcross
Copy link
Contributor

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.

@jeffbcross
Copy link
Contributor Author

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.

@Brocco
Copy link
Contributor

Brocco commented Apr 13, 2016

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));

@jeffbcross
Copy link
Contributor Author

@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

@Brocco Brocco self-assigned this Apr 13, 2016
@Brocco
Copy link
Contributor

Brocco commented Apr 14, 2016

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

Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 16, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 16, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 16, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 16, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 16, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 16, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 18, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 18, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit to Brocco/angular-cli that referenced this issue Apr 18, 2016
Implements the majority of style guide angular#316
Moves systemjs configuration our of index.html angular#429
Brocco added a commit that referenced this issue Apr 18, 2016
Implements the majority of style guide #316
Moves systemjs configuration our of index.html #429
Closes #427
@Brocco
Copy link
Contributor

Brocco commented Apr 18, 2016

Resolved via #427

@Brocco Brocco closed this as completed Apr 18, 2016
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants