new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Vite · Guide · all subjects

environment api/raw devenvironment

2 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Virtual module approach for raw DevEnvironment

If an environment does not implement RunnableDevEnvironment or FetchableDevEnvironment and the code can run in the same runtime as user modules without relying on Node.js-specific APIs, use a virtual module approach. This eliminates the need to access values from code using Vite's APIs. Create a virtual module plugin that resolves a virtual module ID and returns the desired code or exports.

hot.send for environment communication

For raw DevEnvironment code that requires Node.js APIs, use hot.send to communicate with code that uses Vite's APIs from the user modules. Call ssrEnvironment.send(eventName, data) to send messages, and listen with import.meta.hot.on(eventName, callback) in the user module. Be aware that this approach may not work the same way after the build process.

Give your agent this brain