2017-02-15 20:35:46 -08:00

584 B

Global scripts

You can add Javascript files to the global scope via the apps[0].scripts property in .angular-cli.json. These will be loaded exactly as if you had added them in a <script> tag inside index.html.

This is especially useful for legacy libraries or analytic snippets.

"scripts": [
  "global-script.js",
],

You can also rename the output and lazy load it by using the object format:

"scripts": [
  "global-script.js",
  { "input": "lazy-script.js", "lazy": true },
  { "input": "pre-rename-script.js", "output": "renamed-script" },
],