
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
vite-plugin-relay
Advanced tools
❤️ Special thanks to:
I do not actively use this project anymore, however, it will still receive periodic updates.
Follow Relay's guide on how to add Relay to your project.
⚠️ Note: Install
babel-plugin-relay(>= 13.0.1) as devDependencies as instructed, but skip its configuration.vite-plugin-relaywill invoke the babel plugin for you!
Add vite-plugin-relay to your devDependencies:
yarn add vite-plugin-relay -D
Add vite-plugin-relay to your Vite configuration (vite.config.ts or vite.config.js):
import { defineConfig } from "vite";
import relay from "vite-plugin-relay";
export default defineConfig({
plugins: [..., relay],
});
Configure relay-compiler to output artifacts with export default syntax, by setting eagerEsModules to true:
{
"relay": {
"src": "./src",
"schema": "./src/schema.graphql",
"language": "typescript",
"eagerEsModules": true,
"exclude": ["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"]
}
}
Now your project is setup to use Relay with Vite!
Under the hood we are invoking the official babel-plugin-relay. This ensures that our plugin and babel-plugin-relay do not get out of sync over time and also reduces the maintainance costs of this project.
Since v13 babel-plugin-relay automatically gets its configuration from either the package.json, relay.config.js or relay.config.json, so our plugin also doesn't have to expose a configuration API.
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;
}
git clone ...
pnpm i
# If you have never run Playwright run `npx playwright install` to setup your system.
cd examples/vite-3
pnpm dev
pnpm format # Do this before doing a commit
FAQs
A vite plugin for relay
We found that vite-plugin-relay demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.