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

The vue-chartjs/src entry point is still creating a new vue instance. #55

Closed
gwilakers opened this issue Mar 7, 2017 · 6 comments
Closed

Comments

@gwilakers
Copy link

Expected Behavior

As per the docs, this entry point is not supposed to load vue.common.js.

Actual Behavior

Even when using this entry point, vue.common.js is loaded a second time.

Currently importing the package like this:

import { Line } from 'vue-chartjs/src'

Is there additional configuration that needs to be done within my webpack config? I didn't see anything in the docs for this.

Any more information I can provide that would help out just let me know, but my code is not much different from the example code as I was just starting out with this and noticed the second instance.

Environment

  • vue.js version: 2.2.1
  • vue-chart.js version: 2.4.1
  • npm version: 3.10.10
@apertureless
Copy link
Owner

What webpack version are you using?

As you can see in the package.json the main entry is the bundled umd file.

And a transpiled ES module file is set as jsnext:main and module. Which is actually transpiled to be runable, expect that is has import and export statements. So that if you're using rollup / webpack2 you have proper tree-shaking.

If you're using webpack 2, it should automatically load the es module, as it supports the jsnext:main and module .

Webpack 1 does not support this as far as I know. So you have to import the file manually or set an alias.

import { Line } from 'vue-chartjs/es'

You can also import from the src however you need to know what you're doing then, because then you are importing untranspiled files.

@gwilakers
Copy link
Author

Ah sorry, I had thought I included my Webpack version in the initial comment. I am using Webpack 2.2.1.

I am going to run through my configs again at some point today and I will update you on what I figure out. Thanks for the quick response!

@apertureless
Copy link
Owner

Are you using a custom config or the vue init scaffold ?

@gwilakers
Copy link
Author

I am using a custom config.

@apertureless
Copy link
Owner

Can you post your webpack.config or even better, provide a minimal repo for reproduction ?

@apertureless
Copy link
Owner

Any updates on this @gwilakers ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants