Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
We recommend configuring ESM as the default, and we will deprecate the CJS build 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,
},
qrcode: {
// Custom string for the generate network QR code, It will overwrite the server URL
// custom?: string | ((URL: string) => string)
custom: '',
// Disable QRCode
disabled: true,
},
// 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
We found that vite-plugin-url-copy 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.