-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change from
pattern for copying font files
#33
Comments
from
path for copying font filesfrom
pattern for copying font files
Wouldn't it be even better not to have a hard-coded copy task and instead let Webpack copy them when they are referenced somewhere? I mean, that's actually the case for using Webpack. |
It's hard for me to argue against that, but two questions come to mind:
module: {
rules: [
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}
]
}
]
} Without this bit of configuration, my project would not even compile, but it does nothing to actually copy fonts that webpack comes across in any |
Sorry for interrupting your issue, I currently have a similar issue, my SCSS won't pickup the font files, they are being copied to the public folder, but I cant use the font in SCSS. I use the same code as shown above, and everything compiles with no errors. Does somebody have any clue, if there is a extra loader needed for this or is it something else? |
Are you using the correct path to refer to your font files? It should be |
Do you mean like this?
|
@ItsJepser I believe the path is from the public folder, you should just be able to do |
This is due to the version of pattern-lab core that's being used, it was a fork of the gulp version and needed to copy files at that time. I am in full support of changes and improvements. You can fork the repo and follow the other contributing guidelines. I would like to get this version working with the latest version of the core, though my day job has prevented me to really spend a lot of time outside of patches on this project. |
Even when I use /public/ the font isn't loaded in when I try to select it in We've tried alot of loaders, without success. The only thing we're able to do, is download the woff file if we go to: http://localhost:3000/fonts/fontfolder/fontfile.woff Could you help us with an example? |
I'm not sure I can provide the implementation of the latest core, but at least I could extend the Webpack functionality to get rid of the manual copy config and rely to the dependency tree of Webpack during build. I already applied those changes in most project where I used Comcast's Webpack editions, so I for sure could provide this change via a pull request. Will have to check how much time it takes me. |
Current situation: Line 77 of the Webpack configuration defines the glob pattern for copying fonts from the
source
to thepublic
folder. The pattern is currently defined as./*
.Proposed improvement: I would like to update this pattern to
./**/*.*
, as is already the case for images, so that font files which are located in their own subfolders also match the pattern. In my experience, this is frequently the case and changing the pattern would save others the time I spent last Friday trying to debug why my fonts are not being copied over. 😅I'm happy to open a pull request if you consider this a desirable improvement.
The text was updated successfully, but these errors were encountered: