b-tooltip css not working when installing using npm package manager

Viewed 193

I am currently working on making a component much like the contribution graph from Github and struggling a bit to share it as an npm package.

The component vue-contribution-graph packaged with npm doesn't display the tooltip properly. The CSS for the b-tooltipcomponent is working on the original project but it seems not to be included properly in the packaged component. Indeed, after running npm i vue-contribution-graph, the tooltip background doesn't appear.

I have created a GitHub issue just to make it clearer: https://github.com/estelled/vue-contribution-graph/issues/4

The behavior remains the same after installing all the dependencies manually.

I followed this tutorial for npm packaging.

Files changed to package the component:

  1. package.json
  2. added a vue.config.jsfile, to include CSS in the package

How do I fix it?

1 Answers

My guess is that it's not working when installing via npm, because the path to the CSS files are wrong. They are, however, correct when running the vue-contribution-graph package as standalone.


Having looked at your demo.html, it looks like it's requiring a missing file: ./vue-contribution-graph.css. Have you tried setting extract: false for your CSS to automatically be included in the bundle?

Related