
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@iodigital/vite-plugin-msw
Advanced tools
Mock Service Worker browser and node integration for Vite
Mock Service Worker browser and node integration for Vite.
npm install --save-dev @iodigital/vite-plugin-msw
# yarn add --dev @iodigital/vite-plugin-msw
# pnpm add --save-dev @iodigital/vite-plugin-msw
https://mswjs.io/docs/getting-started/mocks
// Import plugin
import msw from "@iodigital/vite-plugin-msw";
// Import msw handlers
import { handlers } from "../mocks/handlers";
// Pass them to plugin
export default defineConfig({
plugins: [msw({ handlers })],
});
interface VitePluginMswOptions {
handlers: RequestHandler[];
mode?: "browser" | "node";
build?: boolean;
}
MSW handlers. More information on how to define these: https://mswjs.io/docs/getting-started/mocks
browser
To start MSW in the client, please follow the Configure worker step and Start worker step in the MSW docs. The mockServiceWorker.js
file will be provided by the Vite Dev Server.
This will handle the mocked service worker handlers via a Vite Dev Server plugin.
false
A true value will output MSW's mockServiceWorker.js
file to the Vite build directory, in case if MSW is needed in production.
npm run dev
npm run build
cd examples/with-vite
npm run dev
curl http://localhost:3000/api/health
npm run build
FAQs
Mock Service Worker browser and node integration for Vite
The npm package @iodigital/vite-plugin-msw receives a total of 481 weekly downloads. As such, @iodigital/vite-plugin-msw popularity was classified as not popular.
We found that @iodigital/vite-plugin-msw demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.