Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Relative Paths for urls #30

Open
darylteo opened this issue Aug 15, 2016 · 5 comments
Open

Relative Paths for urls #30

darylteo opened this issue Aug 15, 2016 · 5 comments

Comments

@darylteo
Copy link

darylteo commented Aug 15, 2016

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
Copy link

@IngwiePhoenix Please fix!

@jardilio
Copy link

jardilio commented Oct 20, 2016

Yeah, my "fix":

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

@unimonkiez
Copy link

@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
Copy link

MoLow commented Nov 8, 2016

I have this issue too. please fix :)

@pankajpatel
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants