huhang-website-mobile/vue.config.js
@zuopngfei 61eeaf35b8 wewe
2025-06-16 19:01:34 +08:00

45 lines
1.0 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { defineConfig } = require('@vue/cli-service')
const path = require('path')
// const webpack = require('webpack')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = defineConfig({
transpileDependencies: false,
lintOnSave: false,
publicPath: process.env.VUE_APP_CDN, // 静态资源路径(默认/,打包后会白屏)
assetsDir: 'static',
productionSourceMap: false,
outputDir: 'dist', // 打包后文件的目录 默认为dist
devServer: {
open: true,
port: 8888,
proxy: {
'/api': {
target: 'https://m.novots.com/',
changeOrigin: true,
pathRewrite: {
'^/api': '/'
}
}
}
},
configureWebpack: {
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': resolve('src'),
'~': process.cwd(),
public: resolve('public'),
components: resolve('src/components'),
util: resolve('src/utils'),
store: resolve('src/store'),
router: resolve('src/router')
}
}
},
})