Skip to content

plotly.js always gets bundled #50

@Onmar

Description

@Onmar

Expected Behavior

Plotly.js does not get bundled into the production build if you are using either the PlotlyViaCDNModule or the PlotlyViaWindowModule.

Actual Behavior

Plotly.js always gets bundled into the chunk the module is imported in (usually main).
This only happens if you install angular-plotly via npm, but not with the source project.

Steps to Reproduce the Problem

  1. Make a new angular project with angular-plotly.js and plotly.js (like described in the README.md)
  2. Add either of the two modules to the app.module.ts (like described in the README.md)
  3. Create a production build with ng build --prod
    You will notice that plotly.js will be bundled into the main.<hash>.js bundle (file size ~3MB)

Specifications

  • Version: 1.1.0

Other Notes

As mentioned above this only happens if you install angular-plotly.js via npm.
If you download the sources (plotly-via-cdn.module.ts and the shared/ folder) and add them manually everything works as intended.
I don't know enough about npm-packages, but it seems that bundling makes it so all Modules are imported into the application as soon as you import one.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions