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 }}
This repository was archived by the owner on Mar 17, 2021. It is now read-only.
If you want for example emit your files at fonts/some-font.ttf loader: "file?name=./fonts/[hash].[ext]"
But you are already extracting your css into css/styles.css new ExtractTextPlugin('css/app.css', { allChunks: true })
Your css files will try load the fonts from css/fonts/...
Because they expect to be in the root of the public folder.
You can fix this by giving the publicPath query to the file-loader
This will emit the files in fonts/* and but the publicPath will be .././fonts/** in your css file..
Maybe it helps some one..
lpil, towry, Strato, esslamben, GiovanniFrigo and 82 morevijithv-synerzip and davevanshasnatbabur, jimmerioles, lon-io and Liby99alexweber, jakub-zawislak, Nicic92, fgaleano, DartMoon and 7 morevyk2rr and chrishaweslephuhai, dylansm, VladislavGist, hasnatbabur, quantumew and 7 more
Activity
hkongm commentedon Aug 19, 2015
same question.
ghost commentedon Aug 20, 2015
it is not a bug, you can add a query parameter
name=xxx
like thissee loader-utils source code
ghost commentedon Sep 29, 2016
If you want for example emit your files at fonts/some-font.ttf
loader: "file?name=./fonts/[hash].[ext]"
But you are already extracting your css into css/styles.css
new ExtractTextPlugin('css/app.css', { allChunks: true })
Your css files will try load the fonts from css/fonts/...
Because they expect to be in the root of the public folder.
You can fix this by giving the
publicPath
query to the file-loaderloader: "file?publicPath=../&name=./fonts/[hash].[ext]"
This will emit the files in fonts/* and but the publicPath will be .././fonts/** in your css file..
Maybe it helps some one..
lpil commentedon Oct 3, 2016
Thanks for the tip! It would be great if this option was documented in the README.
SpaceK33z commentedon Oct 9, 2016
Closing since the question has been answered. Feel free to add this to the readme with a PR.
davevans commentedon Oct 19, 2016
ps: the param to the file-loader is publicPath - beware cut and paste of pubicPath from above
netojose commentedon Oct 23, 2016
@dropfen , publicPath QueryString, best tip ever. Thanks!
tomwang1013 commentedon Jan 26, 2017
we can also set the publicPath to an absolute path, so the assets can be accessed by all css
jimmerioles commentedon Oct 20, 2017
that sneaky
publicPath=../
😄