xingw-z / vite-plugin-raw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vite-plugin-raw

vite-plugin-raw will transform any type file to string

Install

npm install -D vite-plugin-raw

Usage

import vitePluginRaw from 'vite-plugin-raw';
const path = require('path');

module.exports = {
  plugins: [
    vitePluginRaw({
      match: /\.svg$/,
      exclude: [new RegExp(path.resolve(__dirname, './src/assets'))]
    })
  ]
}

or

import richtextRedo from '../assets/richtext_redo.svg?raw';

About


Languages

Language:TypeScript 100.0%