Answer the question
In order to leave comments, you need to log in
How not to import a file in webpack?
Hello.
The question is formulated rather silly, I understand. I will describe in more detail. I have a .less file that includes fonts. Webpack (according to what I googled) can either insert base64 instead of this import, or copy the fonts to the build folder and import them from there. I'm wondering if it's possible to just leave the path to the fonts as it is? Don't import anything. The fonts are in their own folder.
@font-face {
font-family: 'Ubuntu Regular';
src: url('../fonts/Ubuntu-R.ttf');
}
Answer the question
In order to leave comments, you need to log in
What for?
The point is that relative paths will break when moving the CSS to another folder, so it's safer to put the files side by side. In order to correct the paths, you need to know the server configuration. My framework can do this - it just corrects the relative paths to similar files. Webpack doesn't seem to have enough information for this, or it just hasn't been implemented yet.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question