
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
vite-plugin-url-copy
Advanced tools
Auto copy the Vite server URL and generate a QR code for easy access during dev or preview
⚡️ Auto copy the Vite server URL and generate a QR code for easy access during dev or preview.
[!IMPORTANT] Recommended minimum vite version is v4.
Vite CJS Node API deprecated: the CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
Recommend configuring ESM as the default, CJS build will be deprecated in v2.
pnpm i vite-plugin-url-copy -D
package.json
, it's up to you{
"type": "module"
}
vite.config.ts
import ServerUrlCopy from 'vite-plugin-url-copy'
export default defineConfig({
plugins: [ServerUrlCopy()],
server: {
host: true,
},
preview: {
host: true,
}
})
ServerUrlCopy({
// QR code using network URL
qrcode: {
disabled: false,
},
})
pnpm dev
#or
pnpm preview
ServerUrlCopy({
copy: {
// 'local' | 'network'
mode: 'local',
// Custom string to copy when the server start, It will overwrite the server URL
// custom?: string | ((URL: string) => string)
custom: '',
// Disable Copy
disabled: false,
// Custom display color
color: 'green',
},
qrcode: {
// Custom string for the generate QR code, It will overwrite the server URL
// custom?: string | ((URL: string) => string)
custom: '',
// Disable QRCode
disabled: true,
// Custom display color
color: 'green',
},
// Disable plugin
disabled: false,
// Log config info
debug: false,
})
Network may need to enable host
// package.json
{
"scripts": {
"dev": "vite --host"
}
}
// or vite.config.ts
export default defineConfig({
plugins: [ServerUrlCopy()],
server: {
host: true,
},
})
Hey there! If you enjoy my project, please give me a ⭐️. Thanks!
FAQs
Auto copy the Vite server URL and generate a QR code for easy access during dev or preview
The npm package vite-plugin-url-copy receives a total of 317 weekly downloads. As such, vite-plugin-url-copy popularity was classified as not popular.
We found that vite-plugin-url-copy demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.