DragonsInn / fontgen-loader

Automated webfont generation from SVG icons. Use with WebPack!
125 stars 42 forks source link

Relative Paths for urls #30

Open darylteo opened 8 years ago

darylteo commented 8 years ago

I'm generating a package that will be placed in a folder structure like so: "builds/{version}/dist/", which is where all the files will sit. However, when the css file is generated, it generates url links from the root.

Can I configure this loader to do otherwise? After all, it's not like the css and the fonts will be in different places.

I've tried publicPath but that just crashes webpack.

Edit: For the record: I'm hacking around this currently with StringReplacePlugin.

unimonkiez commented 8 years ago

@IngwiePhoenix Please fix!

jardilio commented 7 years ago

Yeah, my "fix":

loader: 'style!raw!string-replace?search=url%5C("%5C/&replace=url("&flags=gm!fontgen'
unimonkiez commented 7 years ago

@jardilio Did something similiar. 'style!replace?flags=g&regex=\/font\/&sub=\.\/font\/!css!fontgen?fileName=./font/[hash][ext]' Though I wrote and now using icon-maker-loader, you might like it.

MoLow commented 7 years ago

I have this issue too. please fix :)

pankajpatel commented 7 years ago

I have this issue as well.

Though I have created the fork of this repo and released as font-gen-loader on npm

The fix for this is simply path.normalize in the script https://nodejs.org/api/path.html#path_path_normalize_path