Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled vis.js bundle is imported #67

Open
the-owl opened this issue May 28, 2019 · 0 comments
Open

Compiled vis.js bundle is imported #67

the-owl opened this issue May 28, 2019 · 0 comments

Comments

@the-owl
Copy link

the-owl commented May 28, 2019

Overview

https://github.com/Lighthouse-io/react-visjs-timeline/blob/master/src/index.js#L1
This import includes a built vis.js bundle, with its own moment.js included. This increases output size and, most importantly, causes issues with moment.js locale configuration (because vis.js dist bundle uses its own copy of moment).

Package versions

react-visjs-timeline: 1.5.0
vis version: 4.21.0

Suggested fix

This is easily fixed by changing import from vis/dist/vis-timeline-graph2d.min to vis/index-timeline-graph2d.js.
Currently I'm using a workaround via a webpack alias:

{
  resolve: {
    alias: {
      'vis/dist/vis-timeline-graph2d.min': 'vis/index-timeline-graph2d.js'
    }
  }
}

This solves my issue with moment.js locales.

@the-owl the-owl changed the title Whole vis.js bundle is imported Compiled vis.js bundle is imported May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant