
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
vite-upload-plugin
Advanced tools
一款vite插件,能够自动将静态资源上传至CDN服务器,并替换源文件地址
npm i vite-upload-plugin -D
# yarn
yarn add vite-upload-plugin -D
在vite.config文件中直接使用:
import viteUploadPlugin from '@q/vite-upload-plugin'
export default defineConfig({
plugins: [
viteUploadPlugin({
async upload(path) {
// 在此处进行上传操作,返回上传后的地址
return newPath
}
})
],
// 注意,下面的配置是必须的
build: {
rollupOptions: {
manualChunks(id) {
if (id.includes('node_modules') || id.includes('App')) {
return 'vendor'
}
}
}
}
})
当进行打包操作时,资源会自动上传并替换源文件链接。
配置中对代码的分割逻辑是必须的,vite默认会把node_modules中的代码打到入口文件中,导致入口文件和其他文件产生循环引用关系,最终无法完成上传,需要将node_modules中的代码分割为独立的包,以免发生循环引用问题。
FAQs
自动上传静态资源到CDN,并替换引用资源地址
We found that vite-upload-plugin 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.