patrickhulce / fontmin-webpack

Minifies icon fonts to just the used glyphs.
MIT License
139 stars 19 forks source link

Converting .ttf #50

Closed TbIKoBKa closed 2 years ago

TbIKoBKa commented 2 years ago

@patrickhulce After bundling i got just minified .ttf file. How to convert it to woff2?

I have such configuration:

module: {
    rules: [
        {
            test: /\.(woff|woff2|eot|ttf|otf)$/i,
            use:  [
                {
                    loader:  'file-loader',
                    options: {
                        name: 'assets/[hash:5].[ext]',
                    },
                },
            ],
        },
    ],
},

plugins: [
    new FontminPlugin({
        autodetect:        true,
        allowedFilesRegex: null,
        skippedFilesRegex: null,
    }),
],
patrickhulce commented 2 years ago

@TbIKoBKa do your other fonts have the same exact file name (minus extension) as the ttf version? See https://github.com/patrickhulce/fontmin-webpack#limitations

TbIKoBKa commented 2 years ago

@patrickhulce No, i have got just .ttf file and i want to convert it to another formats after bundling. Is it possible?

patrickhulce commented 2 years ago

i want to convert it to another formats after bundling. Is it possible?

No, that's more involved than what this package does (requires modifying CSS font declarations, adding new assets to webpack, etc). Sorry!