👋
@pieced/font-config-webpack-plugin
Automatically configuration webpack5 font loader
Install
npm i --save-dev @pieced/font-config-webpack-plugin
Webpack Config
const FontConfigWebpackPlugin = require('@pieced/font-config-webpack-plugin');
module.exports = {
plugins: [new FontConfigWebpackPlugin()],
};
Options
suffix
type array
default ['woff', 'woff2', 'eot', 'ttf', 'otf']
generator
type object
- webpack.rule.generator
- default
const defaultGenerator = {
filename: webpack.mode === 'development' ? '[path][name][ext]' : 'static/font/[contenthash:10][ext]',
}