
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vite-plugin-relay-custom
Advanced tools
Add relay support to your Vite projects.
Created with the help of @Brendonovich and thanks to @kesne for adding pnpm support.
Add vite-plugin-relay and relay to your project.
yarn add react-relay relay-runtime
yarn add -D relay-compiler relay-config vite-plugin-relay
Next setup NPM scripts in the package.json. One is required for Vite and the other for the Relay Compiler
"scripts": {
"dev": "vite",
"relay": "relay-compiler"
},
Next setup relay.config.js more information about this can be found in the official relay docs.
Finally add vite-plugin-relay to your Vite configuration (vite.config.ts).
import { defineConfig } from "vite";
import relay from "vite-plugin-relay";
export default defineConfig({
plugins: [..., relay],
});
Now your project is setup to use Relay with Vite!
Uncaught ReferenceError: global is not definedIf you experience this error in your browser console when using the plugin add the following define to your index.html file before importing your Javascript:
<script>
let global = globalThis;
</script>
If you are planning to use this plugin with server side rendering you may need to define window. You could do this by putting the following snippet in your entry-server.js file.
if (typeof (window as any).global === 'undefined') {
(window as any).global = globalThis;
}
FAQs
A vite plugin for relay
The npm package vite-plugin-relay-custom receives a total of 0 weekly downloads. As such, vite-plugin-relay-custom popularity was classified as not popular.
We found that vite-plugin-relay-custom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.