【发布时间】:2018-12-18 23:41:41
【问题描述】:
我发现了很多关于此的问题,但没有一个答案有效..
我正在尝试将来自此 package 的节点模块中的字体导入 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 和其他各种方法将其放入项目中。有什么线索吗?
【问题讨论】:
-
你能解决这个问题吗?
标签: webpack sass create-react-app node-sass-chokidar