first commit

This commit is contained in:
编码猿
2024-09-27 01:32:49 +08:00
commit 28ebe05a64
7399 changed files with 1174529 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
const path = require('path');
module.exports = {
// devServer:{
// proxy: {
// '/api': {
// target: 'https://test.yishaxiyi.com',
// changeOrigin: true,
// ws: true,
// pathRewrite: {
// '^/api': ''
// }
// }
// }
// },
// pubilcPath:'./',
// assetsDir:'./src/static',
configureWebpack:(config)=>{
},
chainWebpack: (config) => {
/**
* 导入全局css
* @type {*[]}
*/
const types = ['vue-modules', 'vue', 'normal-modules', 'normal'];
types.forEach(type => addStyleResource(config.module.rule('stylus').oneOf(type)));
/**
* 配置路径别名,项目中引用资源的时候路径可以更简短
* 但是ts文件在用的时候,编译器会报错,需要添加 @ts-ignore
* 忽略开发工具的错误。
*/
config.resolve.alias
.set('@static', resolve('src/static'))
.set('@stylus', resolve('src/view/assets/stylus'))
.set('@components', resolve('src/view/components'));
}
}
function resolve(dir) {
return path.join(__dirname, dir);
}
function addStyleResource(rule) {
rule.use('style-resource')
.loader('style-resources-loader')
.options({
patterns: [
path.resolve(__dirname, './src/view/assets/stylus/imports.styl')
],
});
}