react-webpack-generators / generator-react-webpack

Yeoman generator for ReactJS and Webpack
http://newtriks.com/2013/12/31/automating-react-with-yeoman-and-grunt/
MIT License
2.87k stars 356 forks source link

Enhancement: Webpack-Config should allow Webfonts #100

Closed weblogixx closed 9 years ago

weblogixx commented 9 years ago

Hi,

another little thing that I ran into when using your (aweseome) generator: Webfonts (WOFF and WOFF2) are currently not supported by the url-loader plugin configuration.

This could be easily fixed by adjusting the webpack configuration like this:

{
  test: /\.(png|jpg|woff|woff2)$/,
  loader: 'url-loader?limit=8192'
}

Any chance to see this in a future release?

newtriks commented 9 years ago

@weblogixx done my man!

weblogixx commented 9 years ago

@newtriks: Now thats a really fast response! Thank you very much :).

weblogixx commented 9 years ago

@newtriks: There is one part missing in the unit tests (they do not accept the woff stuff in the webpack config).

// In the loaders section:
, {
    test: /\.woff/,
    loader: 'url-loader?limit=10000&mimetype=application/font-woff'
  }, {
    test: /\.woff2/,
    loader: 'url-loader?limit=10000&mimetype=application/font-woff2'
},

Next time ill send a pull request, I swear :).

newtriks commented 9 years ago

@weblogixx Done!

Next time ill send a pull request, I swear :).

... promises promises :stuck_out_tongue:

Now thats a really fast response! Thank you very much :).

giphy