| | |
| | | const path = require('path') |
| | | const CompressionPlugin = require('compression-webpack-plugin') |
| | | const GenerateFilePlugin = require('generate-file-webpack-plugin') |
| | | const CopyWebpackPlugin = require('copy-webpack-plugin') |
| | | |
| | | function resolve(dir) { |
| | | return path.join(__dirname, dir) |
| | |
| | | // 打包app时放开该配置 |
| | | // publicPath:'./', |
| | | configureWebpack: config => { |
| | | // 复制 video-test 文件夹到 public 目录 (已注释,不再自动复制) |
| | | // config.plugins.push( |
| | | // new CopyWebpackPlugin([{ |
| | | // from: path.resolve(__dirname, '../video-test'), |
| | | // to: 'video-test', |
| | | // ignore: ['.*'] |
| | | // }]) |
| | | // ) |
| | | |
| | | // 生产环境取消 console.log |
| | | if (process.env.NODE_ENV === 'production') { |
| | | config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true |
| | |
| | | devServer: { |
| | | port: 10086, |
| | | open: true, |
| | | host:"0.0.0.0" |
| | | // public: '25.30.13.141:3000' |
| | | // proxy: { |
| | | // '/cube': { |
| | | // target: 'http://localhost:8080', // 请求本地 cube后台项目 |
| | | // ws: false, |
| | | // changeOrigin: true, |
| | | // pathRewrite: { |
| | | // '/cube': '' // 默认所有请求都加了cube前缀,需要去掉 |
| | | // } |
| | | // } |
| | | // } |
| | | host:"0.0.0.0", |
| | | proxy: { |
| | | '/cube': { |
| | | target: 'http://localhost:8080', |
| | | ws: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '/cube': '' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | lintOnSave: undefined |