Skip to content

Commit

Permalink
Add url-loader limit to font file packing. (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwaxo authored and illepic committed Mar 21, 2019
1 parent d76f9dc commit 4db1d6c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webpack.particle.js
Expand Up @@ -109,10 +109,19 @@ module.exports = {
},
},
{
// base64 encode all referenced font files for simple loading.
test: /\.(woff|woff2|eot|ttf|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [
{
loader: 'url-loader',
options: {
limit: 50000,

// If a font file is over 50k, output below fonts directory.
// This prevents massive .css file bloat.
name: '[name].[ext]',
outputPath: 'fonts/',
},
},
],
},
Expand Down

0 comments on commit 4db1d6c

Please sign in to comment.