title: Adding Chartist plugin to Angular 5
body: <p>I am trying to build a project in Angular 5 which has chartist @types and js files of chartist plugins.</p>
  <p>The files compile fine in angular 4 but fail to compile or load in Angular 5.
  I am confused as to what I am supposed to do.</p>
  <p><strong>Scenario where compilation fails with error <code>ERROR in error TS5055: Cannot write file '/chartist/chartist-plugin-tooltip.js' because it would overwrite input file</code></strong></p>
  <p>In this scenario I directly import files in the components as follows:</p>
  <pre><code>import * as CLegend from &quot;../../../chartist/chartist.legend&quot;;
  import * as CPoints from &quot;../../../chartist/chartist.pointlabels&quot;;
  import * as CFDoughnut from '../../../chartist/chartist.fill-donut';
  import * as CTooltip from '../../../chartist/chartist-plugin-tooltip';
  </code></pre>
  <p>This works in Angular 4.</p>
  <p><strong>Scenario where compilation succeeds:</strong></p>
  <p>I have added the above mentioned files in <code>angular-cli.json</code> under <code>scripts</code> key with an array.</p>
  <pre><code>  &quot;scripts&quot;: [
      &quot;../chartist/chartist.legend.js&quot;,
      &quot;../chartist/chartist.pointlabels.js&quot;,
      &quot;../chartist/chartist.fill-donut.js&quot;,
      &quot;../chartist/chartist-plugin-tooltip.js&quot;
    ]
  </code></pre>
  <p>I have tried <a href="https://github.com/angular/angular-cli/wiki/stories-global-scripts" rel="nofollow noreferrer">this guide</a>, this allows compilation to succeed but I get errors in JS that <code>Chartist.plugins</code> is undefined.</p>
  <p>I have tried added this in my <code>typings.d.ts</code>:</p>
  <pre><code>interface Chartist {
    plugins? : any
  }
  </code></pre>
  <p>and this</p>
  <pre><code>declare module 'ChartistLegend';
  declare module 'ChartistPoints';
  declare module 'ChartistFDoughnut';
  declare module 'ChartistTooltip';
  </code></pre>
  <p>I have used both individually but not together.</p>
  <p><code>ng -v</code> output:</p>
  <pre><code>    _                      _                 ____ _     ___
     / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
    / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
   / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
  /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
              |___/
  
  Angular CLI: 1.6.3
  Node: 6.11.0
  OS: win32 x64
  Angular: 5.1.3
  ... animations, common, compiler, compiler-cli, core, forms
  ... http, language-service, platform-browser
  ... platform-browser-dynamic, router
  
  @angular/cdk: 5.0.3
  @angular/cli: 1.6.3
  @angular/material-moment-adapter: 5.0.3
  @angular/material: 5.0.3
  @angular-devkit/build-optimizer: 0.0.36
  @angular-devkit/core: 0.0.22
  @angular-devkit/schematics: 0.0.42
  @ngtools/json-schema: 1.1.0
  @ngtools/webpack: 1.9.3
  @schematics/angular: 0.1.11
  @schematics/schematics: 0.0.11
  typescript: 2.4.2
  webpack: 3.10.0
  </code></pre>
  <p>Regards</p>
  <p>PS: sorry for any typos, my hands are freezing.</p>
  <p>EDIT 1: Added angular versions</p>