2 years ago

Vue-cli / Webpack: Where to import CSS?

Posted 2 years ago by Filip_Zdravkovic


I am using Vue-cli [Webpack] and I have installed Vis.js. In App.vue I have added (imported) vis.css:

    @import "../node_modules/vis/dist/vis.css";

Is this the right way? I am asking because when I run npm run dev - everything works fine, all Vis icons are loaded (displayed), but when I run npm run build - when I open the app in the browser - Vis icons are missing and I am getting the following errors:

Image of Yaktocat

I guess that the problem is how the paths in vis.css are treated. If so, how and where should I import (include) it, what's the right way to do it?

Please sign in or create an account to participate in this conversation.