| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- const { defineConfig } = require('@vue/cli-service')
- module.exports = defineConfig({
- transpileDependencies: true,
- configureWebpack: {
- output: {
- filename: 'js/[name].[contenthash:8].js',
- chunkFilename: 'js/[name].[contenthash:8].js'
- }
- },
- css: {
- extract: {
- filename: 'css/[name].[contenthash:8].css',
- chunkFilename: 'css/[name].[contenthash:8].css'
- }
- },
- devServer: {
- port: 81, //固定端口号
- proxy: {
- '/api': {
- target: 'http://127.0.0.1:8080', // 设置你的后端 API 地址
- // target: 'http://192.168.66.133:8080', // 设置你的后端 API 地址
- changeOrigin: true, // 允许跨域
- // pathRewrite: {
- // '^/api': '', // 重写请求路径,去掉 '/api'
- // },
- },
- },
- client: {
- overlay: false
- }
- }
- })
- module.exports.chainWebpack = config => {
- config.module
- .rule('xlsx')
- .test(/\.(xlsx)(\?.*)?$/)
- .use('file-loader')
- .loader('file-loader')
- .options({
- name: 'files/[name].[hash:8].[ext]'
- });
- };
|