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 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.