【发布时间】:2019-05-22 12:36:07
【问题描述】:
我正在使用 laravel mix,我想编译我的字体。我的字体已编译,但它们的名称是从根目录读取的。在底部查看我的代码。
@font-face {
font-family: 'icomoon';
src: url('../fonts/product-fonts/icomoon.eot');
src: url('../fonts/product-fonts/icomoon.eot') format('embedded-opentype'),
url('../fonts/product-fonts/icomoon.ttf') format('truetype'),
url('../fonts/product-fonts/icomoon.woff') format('woff'),
url('../fonts/product-fonts/icomoon.svg') format('svg');
font-weight: normal;
font-style: normal;
}
这是我的 sass 代码,最终编译如下:
@font-face {
font-family: 'icomoon';
src: url(/fonts/icomoon.eot?c2f80bad46e9a20b6278361015fef1cd);
src: url(/fonts/icomoon.eot?c2f80bad46e9a20b6278361015fef1cd) format("embedded-opentype"), url(/fonts/icomoon.ttf?5fa3cdef859a193e0f02c75fbd91d73a) format("truetype"), url(/fonts/icomoon.woff?96c27a3f7e16f9927cc8a0d2818c4e8e) format("woff"), url(/fonts/icomoon.svg?6e4d8f919ddb5d210c8807eb99149359) format("svg");
font-weight: normal;
font-style: normal;
}
但我想编译以下内容:
@font-face {
font-family: 'icomoon';
src: url(../fonts/icomoon.eot?c2f80bad46e9a20b6278361015fef1cd);
src: url(../fonts/icomoon.eot?c2f80bad46e9a20b6278361015fef1cd) format("embedded-opentype"), url(../fonts/icomoon.ttf?5fa3cdef859a193e0f02c75fbd91d73a) format("truetype"), url(../fonts/icomoon.woff?96c27a3f7e16f9927cc8a0d2818c4e8e) format("woff"), url(../fonts/icomoon.svg?6e4d8f919ddb5d210c8807eb99149359) format("svg");
font-weight: normal;
font-style: normal;
}
因为我的 css 文件在另一个文件夹中
【问题讨论】:
标签: javascript laravel webpack laravel-mix