|
@@ -7,7 +7,10 @@ import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
|
|
|
export default defineConfig(({ mode }) => {
|
|
export default defineConfig(({ mode }) => {
|
|
|
const isProduction = mode === 'production'
|
|
const isProduction = mode === 'production'
|
|
|
return {
|
|
return {
|
|
|
- base: isProduction ? './' : '/',
|
|
|
|
|
|
|
+ // 根据环境设置不同的base路径
|
|
|
|
|
+ // 开发环境使用根路径'/',方便本地开发访问
|
|
|
|
|
+ // 生产环境使用'/overseas-mall/',与nginx配置匹配
|
|
|
|
|
+ base: isProduction ? '/overseas-mall/' : '/',
|
|
|
plugins: [
|
|
plugins: [
|
|
|
vue(),
|
|
vue(),
|
|
|
Components({
|
|
Components({
|