Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

About

Adds necessary shims so that React PDF can be used with Vite

Resources

Stars

25 stars

Watchers

1 watching

Forks

Latest commit

 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED

This is no longer necessary. Simply use @react-pdf/renderer >= 3.0.0 and it should work out of the box. Thanks @carlobeltrame for your work upstream so that React PDF works with modern bundlers out of the box!

vite-plugin-shim-react-pdf

Adds necessary shims so that React PDF can be used with Vite.

Usage

$ yarn add @react-pdf/renderer
$ yarn add --dev vite-plugin-shim-react-pdf

Then in vite.config.js:

import { defineConfig } from "vite";
import reactRefresh from "@vitejs/plugin-react-refresh";
import shimReactPdf from "vite-plugin-shim-react-pdf";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [reactRefresh(), shimReactPdf()],
});

Both yarn dev and yarn build should now work correctly in your Vite project.

About

Adds necessary shims so that React PDF can be used with Vite

Resources

Stars

25 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages