12345678910111213141516171819202122232425262728293031323334 |
- const { defineConfig } = require('@vue/cli-service')
- const path = require('path')
- function resolve (dir) {
- return path.join(__dirname, dir)
- }
- module.exports = defineConfig({
- transpileDependencies: true,
- devServer: {
- proxy: { // 配置跨域
- '/api': {
- target: 'http://duanju.wenxingshuju.com',
- changeOrigin: true, // 允许跨域
- pathRewrite: {
- '^/api': '' // 请求的时候使用这个api就可以
- }
- }
- }
- },
- lintOnSave: false,
- publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
- outputDir: 'dist',
- productionSourceMap: false,//打包不到.map文件
- configureWebpack: {
- // provide the app's title in webpack's name field, so that
- // it can be accessed in index.html to inject the correct title.
- resolve: {
- alias: {
- '@': resolve('src')
- }
- }
- },
- })
|