@mrcen-dev/upload-cdn-vite-plugin
v1.5.3
Published
#### 一个用于 vite 打包后上传 cdn(七牛云) 的 VitePlugin
Downloads
11
Readme
upload-cdn-vite-plugin
一个用于 vite 打包后上传 cdn(七牛云) 的 VitePlugin
使用方法
安装
yarn add @mrcen-dev/upload-cdn-vite-plugin -D
使用
// vite.config.ts
export default defineConfig({
plugins: [vue(), uploadCdnVitePlugin({
// 七牛云 accessKey
accessKey: '',
// 七牛云 secretKey
secretKey: '',
// 域名,空间访问的域名 (http://xxx.xxx.cm/)
domain: '',
// 七牛云 空间名 (例:cdnver)
bucket: 'cdnver',
// 打包后的文件夹(需用join连接,获取绝对路径)
targetDir: join(__dirname, './', 'dist'),
// 是否强制覆盖
isCover: true,
// 文件的前缀 (影响最终访问地址:http://xxx.xxx.cm/v1/demo2/xxxx.js)
projectName: 'v1/demo2/'
})
],
})