first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
const path = require('path')
module.exports = {
publicPath: './',
lintOnSave: false,
productionSourceMap: false,
devServer: {
hot: true,
hotOnly: true,
host: '0.0.0.0',
port: 9090,
compress: true,
open: true,
openPage: '#/',
overlay: {
warnings: true,
errors: true,
},
proxy: {
'/api': {
target: 'http://115.159.153.142:9010/',
changeOrigin: true,
ws: true,
pathRewrite: {
'^/api': ''
}
}
}
},
chainWebpack: config => {
// 去除 preload 和 prefetch,减少页面请求次数
config.plugins.delete('preload')
config.plugins.delete('prefetch')
// 配置路径别名
config.resolve.alias
.set('@', resolve('src'))
.set('!', resolve('src/assets/styl/page'))
// 配置css的全局自动导入
const types = ['vue-modules', 'vue', 'normal-modules', 'normal']
types.forEach(type => addStyleResource(config.module.rule('stylus').oneOf(type)))
},
};
function addStyleResource (rule) {
rule.use('style-resource')
.loader('style-resources-loader')
.options({
patterns: [
path.resolve(__dirname, './src/assets/styl/imports.styl'),
],
})
}
function resolve (dir) {
return path.join(__dirname, dir)
}