DragonsInn / fontgen-loader

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

public path issue #22

Open linyi01 opened 8 years ago

linyi01 commented 8 years ago

fontgen-loader uses path.join(pub, url) to generate urls in css, but sometimes the publicPath is a CDN link(e.g. https://cdn.com), the generated url is incorrect.

kgdev commented 8 years ago

23

lbineau commented 8 years ago

Same issue here (I have a different public path than usual). So it generates the font files properly but the require to generate CSS files is not working.

  output: {
    path: path.join(__dirname, '../dist'),
    filename: 'bundle.js',
    publicPath: 'http://localhost:3000/'
  },
ERROR in ./~/css-loader!./~/fontgen-loader!./src/fonts/icons/icons.font.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./http:/localhost:3000/cdb8f36dd927c0c211ce6ad980247d74-Awesomecons.eot in /Users/........../src/fonts/icons
 @ ./~/css-loader!./~/fontgen-loader!./src/fonts/icons/icons.font.js 6:88-170

ERROR in ./~/css-loader!./~/fontgen-loader!./src/fonts/icons/icons.font.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./http:/localhost:3000/61a8badb24a0fb8cded9d75b6d9b572e-Awesomecons.woff in /Users/........../src/fonts/icons
 @ ./~/css-loader!./~/fontgen-loader!./src/fonts/icons/icons.font.js 6:223-306

ERROR in ./~/css-loader!./~/fontgen-loader!./src/fonts/icons/icons.font.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./http:/localhost:3000/3ecd05a81970adec606ff2922b05c922-Awesomecons.ttf in /Users/........../src/fonts/icons
 @ ./~/css-loader!./~/fontgen-loader!./src/fonts/icons/icons.font.js 6:339-421

ERROR in ./~/css-loader!./~/fontgen-loader!./src/fonts/icons/icons.font.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./http:/localhost:3000/3a61225d681cdef00a2e236b3a1983fd-Awesomecons.svg in /Users/........../lp_kiosk/src/fonts/icons
 @ ./~/css-loader!./~/fontgen-loader!./src/fonts/icons/icons.font.js 6:458-540

I think the problem is exactly the same.

mikestopcontinues commented 8 years ago

Same issue. If all it takes to solve is the PR, please merge!

jzavisek commented 8 years ago

Same issue, please merge the PR 🙏

Bdragon93 commented 7 years ago

Hi @IngwiePhoenix Can you help me merge and release this issue (https://github.com/DragonsInn/fontgen-loader/pull/23/files). I work in a team, so difficult to maintain and waste time to fix directly module after install or deploy :( . Thank you.

deeg commented 7 years ago

Is there a work around for this besides merging this PR?

kumar935 commented 7 years ago

A workaround I've been using is just using 'embed' property like so:

{
        "test": /\.font\.(js|json)$/,
        "loader": 'style!css!fontgen?embed'
}

which creates data-uri instead of having paths.

lbineau commented 7 years ago

@kumar935 That's what I'm using as a workaround but not ideal though.

jeerbl commented 7 years ago

Guys,

I took over the project and fixed some issues as it wasn't being updated. It is here, I renamed it as webfonts-loader so I can push it on npm.

Cheers, Jerome

mikestopcontinues commented 7 years ago

Cool, I'll use yours going forward!