1.3.4 • Published 15 days ago

reiconify-loader v1.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days ago

reiconify-loader

webpack loader for reiconify.

Usage

Add plugin to webpack.config.js:

/** @type {import('webpack').Configuration} */
module.exports = {
  module: {
    rules: [
      {
        test: /\.svg$/,
        oneOf: [
          {
            resourceQuery: /react/,
            use: {
              loader: 'reiconify-loader',
              // whether to use React Native
              // options: {
              //   native: true,
              // },
            },
          },
          // optional fallback
          {
            use: 'file-loader',
          },
        ],
      },
    ],
  },
}

Import icons:

// types for web
/// <reference types="reiconify-loader/client" />

// types for React Native
/// <reference types="reiconify-loader/native" />

// import React icon
import AlarmIcon from './icons/alarm.svg?react'

// load with url
import checkUrl from './icons/check.svg'
1.3.4

15 days ago

1.3.3

1 month ago

1.3.2

1 month ago

1.3.1

1 month ago

1.3.0

1 month ago

1.2.0

2 months ago

1.1.0

2 years ago