@webpackon/use-fonts
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

Webpackon

@webpackon/use-fonts

Adds loader for fonts.

Supported extensions:

  • otf
  • eot
  • ttf
  • woff
  • woff2

Install

npm i @webpackon/use-fonts --save
yarn add @webpackon/use-fonts

API

const { useFonts } = require('@webpackon/use-fonts');

useFonts(params?: UseFontsParams)(config: WebpackConfig)

UseFontsParams

export type UseFontsParams = {
  transpileModules?: string[];
  loaderParams?: {
    generator?: Record<string, any>;
  }
};
useFonts({
  transpileModules: ['my-package']
})

Example

Full examples are here

const path = require('path');

const { compose } = require('@webpackon/core');
const { useFonts } = require('@webpackon/use-fonts');

module.exports = (_, { mode }) =>
  compose(
    useFonts()
  )({
    target: 'web',
    entry: path.resolve(__dirname, 'src', 'index.tsx'),
  });

Package Sidebar

Install

npm i @webpackon/use-fonts

Weekly Downloads

26

Version

1.1.2

License

MIT

Unpacked Size

5.21 kB

Total Files

9

Last publish

Collaborators

  • and_tem