Fetch the repository succeeded.
This action will force synchronization from 超级AI大脑/springboot-openai-chatgpt, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
let optimization = {}
let css = {}
if (process.env.NODE_ENV === 'production') {
optimization.minimize = true
optimization.minimizer = [new TerserPlugin({
parallel: true,
sourceMap: true,
terserOptions: {
warnings: false,
compress: {
drop_console: true, // 注释console
drop_debugger: true, // 注释debugger
pure_funcs: ["console.log"]
}
}
})]
css.extract = {
ignoreOrder: true
}
}
module.exports = {
publicPath: "/",
lintOnSave: true,
productionSourceMap: false,
chainWebpack: (config) => {
//忽略的打包文件
config.externals({
'vue': 'Vue',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'element-ui': 'ELEMENT',
})
const entry = config.entry('app')
entry
.add('babel-polyfill')
.end()
entry
.add('classlist-polyfill')
.end()
entry
.add('@/mock')
.end()
},
css,
configureWebpack: {
optimization,
plugins: [
new CompressionWebpackPlugin({
// 正在匹配需要压缩的文件后缀
test: /.(js|css|svg|woff|ttf|json|html)$/,
// 大于10kb的会压缩
threshold: 10240
// 其余配置查看compression-webpack-plugin
}),
new MonacoWebpackPlugin(),
]
},
devServer: {
// 端口配置
port: 1888,
// 反向代理配置
proxy: {
'/api': {
//本地服务接口地址
target: 'http://127.0.0.1:9872',
ws: true,
pathRewrite: {
'^/api': '/'
}
}
},
disableHostCheck: true
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。