
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
vite-plugin-serve-static
Advanced tools
A Vite plugin for serving static files during local development
A simple Vite plugin for serving arbitrary static files that aren't in your public
directory.
// vite.config.ts
import path from "path";
import { defineConfig } from "vite";
import serveStatic from "vite-plugin-serve-static";
const serveStaticPlugin = serveStatic([
{
pattern: /^\/metadata\.json/,
resolve: "./metadata.json",
},
{
pattern: /^\/dog-photos\/.*/,
resolve: ([match]) => path.join("..", "dog-photos", match),
},
{
pattern: /^\/author-photos\/(.*)/,
resolve: (groups) => path.join("..", "authors", groups[1]) + ".jpg",
},
]);
export default defineConfig({
plugins: [serveStaticPlugin],
});
The configuration is defined as an array of objects defining which patterns to intercept and how to resolve them.
Each pattern
is defined as a regular expression. The resolve
property can either be a string containing the path to a single file or a function that returns a string given the result of executing the pattern
against the request path.
Licensed under the MIT License.
FAQs
A Vite plugin for serving static files during local development
The npm package vite-plugin-serve-static receives a total of 2,368 weekly downloads. As such, vite-plugin-serve-static popularity was classified as popular.
We found that vite-plugin-serve-static demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.