Skip to content

Files

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Latest commit

56f3214 · Feb 16, 2017

History

History
23 lines (18 loc) · 583 Bytes

global-scripts.md

File metadata and controls

23 lines (18 loc) · 583 Bytes

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" },
],