Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@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
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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.