我发现了很多关于此的问题,但没有一个答案有效..
我正在尝试将此包中的节点模块中的字体导入 Create React 应用程序
我已经设法让它编译
@import './../node_modules/roboto-fontface/css/roboto/sass/roboto-fontface.scss';
但是,一旦我运行它,我就会得到
Module not found: You attempted to import ../../../fonts/roboto/Roboto-Black.eot
which falls outside of the project src/ directory. Relative imports outside of
src/ are not supported. You can either move it inside src/, or add a symlink to
it from project's node_modules/.
我已经尝试过使用 ~、node_modules 和其他各种将其纳入项目的方法。有什么线索吗?