1 Star 0 Fork 100

山哈蓝/AS-Editor-H5

forked from 孤傲/AS-Editor-H5 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vue.config.js 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
孤傲 提交于 2021-10-27 17:37 . v0.0.1
const path = require('path');//引入path模块
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const isProd = process.env.NODE_ENV === 'production'
function resolve(dir) {
return path.join(__dirname, dir)//path.join(__dirname)设置绝对路径
}
module.exports = {
publicPath: './',
outputDir: 'AS-Editor-H5',
assetsDir: 'static',
productionSourceMap: false,
devServer: {
open: true,
port: 8080,
proxy: {
'/api': {
target: 'https://firetest-player.laidui.vip/',
ws: true,
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
},
configureWebpack: config => {
if (isProd) {
// 配置webpack 压缩
config.plugins.push(
new CompressionWebpackPlugin({
test: /\.js$|\.html$|\.css$/,
// 超过4kb压缩
threshold: 4096
})
)
}
},
chainWebpack: (config) => {
config.resolve.alias
.set('@', resolve('./src'))
.set('components', resolve('./src/components'))
.set('css', resolve('./src/assets/css'))
.set('iconfont', resolve('./src/assets/iconfont'))
.set('img', resolve('./src/assets/images'))
.set('utils', resolve('./src/utils'))
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/shanhalan/as-editor-h5.git
git@gitee.com:shanhalan/as-editor-h5.git
shanhalan
as-editor-h5
AS-Editor-H5
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385