You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CSS preprocessor - font assets outside of src聽#4031
So when I run a build I see Module not found: Error: You attempted to import ../fonts/sourcesanspro-light-webfont.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/.
That all makes sense.
I'm curious to know if you've seen something like this before and have a work around for it. I've tried adding a few extra scripts to copy the fonts directory from node_modules into src but of course that doesn't help because the @font-face is still going outside of src.
I can attempt another workaround by only including the .scss that I want from the framework (excluding the fonts) and downloading the fonts and checking them into my repo in the public directory, but wanted to see if I was missing an obvious solution first.
Sass support will be released in 2.0 (fyi), and the best advice I can give you is just to move your fonts/ folder into src/ -- I'm sorry if this isn't the most terribly helpful answer, but it's our typical response.
Since you require some path trickery, you might have to do the following:
src/assets/css/yourcss.css
src/assets/fonts # the copied fonts
Is there a reason you don't want them in your src/ folder?
I'm in a similar situation, and first thought was to not have them in the src/ directory since they would seem to be more binary assets than text source code.
Activity
Timer commentedon Apr 15, 2018
Sass support will be released in 2.0 (fyi), and the best advice I can give you is just to move your
fonts/folder intosrc/-- I'm sorry if this isn't the most terribly helpful answer, but it's our typical response.Since you require some path trickery, you might have to do the following:
Is there a reason you don't want them in your
src/folder?SeanFelipe commentedon Jan 2, 2019
I'm in a similar situation, and first thought was to not have them in the
src/directory since they would seem to be more binary assets than text source code.