vue项目自动化部署到亚马逊S3或者阿里云OSS或者服务器
生活随笔
收集整理的這篇文章主要介紹了
vue项目自动化部署到亚马逊S3或者阿里云OSS或者服务器
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
部署到AWS S3?
? ? 1.npm
npm i aws-s3-webpack-plugin? ? 2.? 具體參數(shù)看文檔? ?
config.plugin("aws-s3-webpack-plugin").use(require("aws-s3-webpack-plugin"), [{buildPath: "dist/**",region: process.env.VUE_APP_s3_region,accessKeyId: process.env.VUE_APP_s3_accessKeyId,secretAccessKey: process.env.VUE_APP_s3_secretAccessKey,bucket: process.env.VUE_APP_s3_bucket,generateObjectPath: (filename, file) => {return (process.env.VUE_APP_s3_filepath + file.replace(/dist\//, ""));},},]);VUE_APP_s3_region= 'xx-xxx-xxx' VUE_APP_s3_accessKeyId= 'xxxxx' VUE_APP_s3_secretAccessKey= 'xxxx' VUE_APP_s3_bucket= 'xxx' VUE_APP_s3_filepath='html/xx/'部署到oss? ? aliyunoss-webpack-plugin?
? ?1.npm
npm install aliyunoss-webpack-plugin --save-dev? ? 2.? 具體參數(shù)看文檔? ?
cli2 webpack.prod.conf.js const AliyunossWebpackPlugin = require('aliyunoss-webpack-plugin')plugins: [...new AliyunossWebpackPlugin({buildPath: 'dist/**',region: your.region,accessKeyId: your.accessKeyId,accessKeySecret: your.accessKeySecret,bucket: your.bucket,generateObjectPath: function(filename, file) {//配置上傳地址return file.replace(/dist\//, '')},}) }cli3 vue.config.jschainWebpack(config) {config.when(process.env.ENV !== "development", (config) => {config.plugin("aliyunoss-webpack-plugin").use(require("aliyunoss-webpack-plugin"), [{buildPath: "dist/**",region: process.env.VUE_APP_region,accessKeyId: process.env.VUE_APP_accessKeyId,accessKeySecret: process.env.VUE_APP_accessKeySecret,bucket: process.env.VUE_APP_bucket,generateObjectPath: (filename, file) => {return process.env.VUE_APP_filepath + file.replace(/dist\//, "");},},]);});}部署到服務(wù)器? ?fjpublish 詳情看文檔吧
https://fjpublish.manman.io/
總結(jié)
以上是生活随笔為你收集整理的vue项目自动化部署到亚马逊S3或者阿里云OSS或者服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【水动力学】02 一维河道建模
- 下一篇: 5G标准的演进