提交 4cdbcfce authored 作者: 王鹏飞's avatar 王鹏飞

build: 静态资源上传CDN

上级 a9312e5e
...@@ -4,7 +4,7 @@ import chalk from 'chalk' ...@@ -4,7 +4,7 @@ import chalk from 'chalk'
import OSS from 'ali-oss' import OSS from 'ali-oss'
const log = console.log const log = console.log
const __dirname = path.resolve()
const client = new OSS({ const client = new OSS({
region: 'oss-cn-beijing', region: 'oss-cn-beijing',
accessKeyId: 'LTAIOTuuLTaWoGJj', accessKeyId: 'LTAIOTuuLTaWoGJj',
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"dev": "vite --mode dev", "dev": "vite --mode dev",
"build": "vue-tsc --noEmit && vite build --mode prod", "build": "vue-tsc --noEmit && vite build --mode prod && npm run deploy",
"build:test": "vue-tsc --noEmit && vite build --mode test", "build:test": "vue-tsc --noEmit && vite build --mode test",
"build:pre": "vue-tsc --noEmit && vite build --mode pre", "build:pre": "vue-tsc --noEmit && vite build --mode pre",
"preview": "vite preview", "preview": "vite preview",
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"deploy": "node ./deploy.js" "deploy": "node ./deploy.js"
}, },
"type": "module",
"dependencies": { "dependencies": {
"@vueuse/core": "^8.2.4", "@vueuse/core": "^8.2.4",
"axios": "^0.26.1", "axios": "^0.26.1",
......
...@@ -6,23 +6,26 @@ import { defineConfig } from 'vite' ...@@ -6,23 +6,26 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import checker from 'vite-plugin-checker' import checker from 'vite-plugin-checker'
export default defineConfig({ export default defineConfig(({ mode }) => {
plugins: [checker({ eslint: { lintCommand: 'eslint "./src/**/*.{vue,js,jsx,ts,tsx}"' } }), vue()], return {
server: { base: mode === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/vst/' : '/',
open: true, plugins: [checker({ eslint: { lintCommand: 'eslint "./src/**/*.{vue,js,jsx,ts,tsx}"' } }), vue()],
host: 'dev.ezijing.com', server: {
https: { open: true,
key: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.key')), host: 'dev.ezijing.com',
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem')) https: {
key: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.key')),
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem'))
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
css: {
// 禁用SASS警告提醒
preprocessorOptions: { scss: { charset: false } }
} }
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
css: {
// 禁用SASS警告提醒
preprocessorOptions: { scss: { charset: false } }
} }
}) })
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论