| | |
| | | outputDir: 'dist',
|
| | | // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
| | | assetsDir: 'static',
|
| | | // 是否开启eslint保存检测,有效值:ture | false | 'error'
|
| | | lintOnSave: process.env.NODE_ENV === 'development',
|
| | | // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
| | | productionSourceMap: false,
|
| | | transpileDependencies: ['quill'],
|
| | | // webpack-dev-server 相关配置
|
| | | devServer: {
|
| | | host: '0.0.0.0',
|
| | |
| | | proxy: {
|
| | | // detail: https://cli.vuejs.org/config/#devserver-proxy
|
| | | [process.env.VUE_APP_BASE_API]: {
|
| | | target: `http://localhost:8080`,
|
| | | target: `http://localhost:18080`,
|
| | | changeOrigin: true,
|
| | | pathRewrite: {
|
| | | ['^' + process.env.VUE_APP_BASE_API]: ''
|
| | |
| | | plugins: [
|
| | | // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
|
| | | new CompressionPlugin({
|
| | | cache: false, // 不启用文件缓存
|
| | | test: /\.(js|css|html)?$/i, // 压缩文件格式
|
| | | filename: '[path].gz[query]', // 压缩后的文件名
|
| | | algorithm: 'gzip', // 使用gzip压缩
|
| | | minRatio: 0.8 // 压缩率小于1才会压缩
|
| | | cache: false, // 不启用文件缓存
|
| | | test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
|
| | | filename: '[path][base].gz[query]', // 压缩后的文件名
|
| | | algorithm: 'gzip', // 使用gzip压缩
|
| | | minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
|
| | | deleteOriginalAssets: false // 压缩后删除原文件
|
| | | })
|
| | | ],
|
| | | },
|