-
Notifications
You must be signed in to change notification settings - Fork 184
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
WIP: Vue package does not have an index.js #231
Comments
I'm curious what the "official" vue solution is ... since the package was created with the vue-cli in library mode my assumption is that this is how vue libraries expect to receive libraries. How does @carbon/vue package itself? |
@cal-smith @moores2 The issue might actually be bigger than I initially thought. The files seem to not export anything (according to codesandbox, try a few console logs here https://codesandbox.io/s/040w2rqrxp) Maybe I'm missing something, in which case would you please make that codesandbox work? thanks |
It seems like the files (charts-vue.umd and charts-vue.common) export a single default entry point that is used in |
So just the |
Yeah I realized that too after looking at Simon's codesandbox. Crazy! 😄 |
We would like to have 2 options for consuming the Vue wrappers: Firstly, to just load all of the chart components globally into Vue, like this:
to make this work my understanding is that the The second option is to allow consumers to selectively import just the wrappers/components that they want, like this:
As for packaging, carbon-components-vue and carbon-components both put a \dist and \src directory into the NPM package, so that's where I was heading. However, I see that carbon-charts-react puts the built JS file into a \bundle directory and the source files in the root. So, if we wish to ship source and built files in the NPM package what it the preferred directory organisation? |
It would be ideal is we could support both (global registration and selective imports) - does it do this now @moores2? Or would that be something we'd have to configure? As for packaging - if you pull master you'll see we switched around how we're building things. Everything is built into and deployed from That said, bundles should be built into |
We are currently publishing this tree to NPM for our
vue
package:It is missing a fallback
index.js
. Therefore in cases where you do this:You would encounter this error:
We should create an index.js that'll export out modules from a specific bundle, so you won't have to do this:
@moores2, @ZrianinaMariia
The text was updated successfully, but these errors were encountered: