import css not build with npm run build
jatinbphp opened this issue · 2 comments
Hello,
I am using this in vue 3.
Its works well on local when I run it with npm run serve command.
but when I create build for server with npm run build, css is not loading there.
import VueSimpleContextMenu from 'vue-simple-context-menu';
import 'vue-simple-context-menu/dist/vue-simple-context-menu.css';
above css is not loading, any idea how to fix this ?
Hey there, sorry you're having trouble.
Hmm, that sounds strange. What's interesting is that you said it works locally but not during the build process. That makes me think there is something up with your build process.
Can you share more code, or a project repo? Is the site live, so I can check it out? Is the other CSS in your app working?
Really the answer here is going to depend on your build tools. If your build tool is not picking up the css when imported in the JavaScript - then maybe you need to adjust a setting to allow that to happen. Are you using webpack or vite?
If all else fails - you can import the CSS directly in your final HTML file from the unpkg link: https://unpkg.com/vue-simple-context-menu/dist/vue-simple-context-menu.css
Hello,
Thank you for quick response.
Yes, Site is live and it has repository.
My other css are working well, even if I import them from node modules.
I am using VUE CLI which I think using webpack.
At last, I have solved this issue by following your last comment. I have import css directly into my html.
So Thank you for that suggestion.
Thanks and Regards.