Some checks failed
Deploy / deploy (push) Has been cancelled
Full-stack web application for Telegram management - Frontend: Vue 3 + Vben Admin - Backend: NestJS - Features: User management, group broadcast, statistics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
const CompressionWebpackPlugin = require('compression-webpack-plugin');
|
|
const path=require("path");
|
|
function resolve (dir) {
|
|
return path.join(__dirname, dir)
|
|
}
|
|
module.exports = {
|
|
productionSourceMap:false,
|
|
//是否开启eslint保存检测,值为true|false|error
|
|
lintOnSave:false,
|
|
devServer:{
|
|
port:3001,
|
|
open:true,
|
|
disableHostCheck: true,
|
|
},
|
|
chainWebpack: (config) => {
|
|
config.resolve.alias
|
|
.set('@', resolve('src'))
|
|
},
|
|
configureWebpack: ()=> {
|
|
let obj={};
|
|
if (process.env.NODE_ENV==="production") {
|
|
obj.plugins=[new CompressionWebpackPlugin({
|
|
algorithm: 'gzip',
|
|
test: /\.js$|\.html$|\.css/, //匹配文件名
|
|
threshold: 10240,//对超过10k的数据进行压缩
|
|
minRatio: 0.8 //只有压缩率小于这个值的资源才会被处理。默认值是 0.8。
|
|
})]
|
|
}
|
|
//不打包的库
|
|
// obj.externals={
|
|
// vue: "Vue",
|
|
// vuex: "Vuex",
|
|
// "vue-router": "VueRouter",
|
|
// };
|
|
return obj;
|
|
},
|
|
css: {
|
|
loaderOptions: {
|
|
sass: {
|
|
prependData: `
|
|
@import "@/assets/scss/theme.scss";
|
|
`
|
|
}
|
|
}
|
|
}
|
|
}
|