'Importing a css npm package in css file

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?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source