Skip to content

How to embed "regular" JS-Libs (e.g. Chart.js, dragula.js) in dev & prod built #1015

@hmrc87

Description

@hmrc87

There are a lot of discussions going on regarding the --prod built and how difficult it can be to embed 3rd-Party libraries. So far I have managed to add the following libraries, they run perfectly in dev and prod-built with beta5

  • ng2-uploader
  • ng2-bootstrap
  • ng2-table

I wanted to add ng2-dragula and ng2-charts but each of them rely on a separate JavaScript-Library (chart.js and dragula.js) which I am only able to get up and running in dev-mode and when I add the import to index.html.

When I add them via system-config.js I only get errors. I tried changing the format to cjs or register or just leave it away. But I didn't find a way to add a "regular JS library like "Chart.JS" to the angular-cli project so that it runs in dev and --prod mode.

Metadata

Metadata

Assignees

No one assigned

    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