3

I made a NPM package which contains a CSS file which I have to include in my main CSS file. In a normal html CSS website I have to write @import url("./node_modules/web-creative-fonts/index.css") but what I want to do is that we just have to write @import "web-creative-fonts" . I studied a bit about it and found that we can make a webpack.config.js to do it ,but I am not able to figure out how.

Can anyone help?

1 Answers1

1

I think you can use something like css-loader. It's a Webpack plugin that makes importing CSS from NPM a breeze.

Adityo Pratomo
  • 253
  • 1
  • 2
  • 7